aboutsummaryrefslogtreecommitdiff
path: root/drivers/sdio
diff options
context:
space:
mode:
authorSameo <sameo@openedhand.com>2008-11-19 17:09:37 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:09:37 +0000
commit97055983b4cc108141e61c0f45a8b1c5eccd77fb (patch)
tree720c57ee6ffc501ba9a0a78a8f25917c8afaed7b /drivers/sdio
parent9d611bd6594ee4966435c54c26b538156b9a0dd7 (diff)
fix-wlan-disable.patch
see http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=1288
Diffstat (limited to 'drivers/sdio')
-rw-r--r--drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c1
-rw-r--r--drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h1
-rw-r--r--drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c19
-rw-r--r--drivers/sdio/function/wlan/ar6000/include/wmi_api.h1
-rw-r--r--drivers/sdio/function/wlan/ar6000/wmi/wmi.c33
5 files changed, 52 insertions, 3 deletions
diff --git a/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c b/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c
index bb9ef55b071..d35f31c692b 100644
--- a/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c
+++ b/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c
@@ -704,6 +704,7 @@ ar6000_avail_ev(HTC_HANDLE HTCHandle)
ar->arHtcTarget = HTCHandle;
ar->arHifDevice = HTCGetHifDevice(HTCHandle);
ar->arWlanState = WLAN_ENABLED;
+ ar->arRadioSwitch = WLAN_ENABLED;
ar->arDeviceIndex = device_index;
A_INIT_TIMER(&ar->arHBChallengeResp.timer, ar6000_detect_error, dev);
diff --git a/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h b/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h
index c7b6ec49268..655288b32ba 100644
--- a/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h
+++ b/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h
@@ -201,6 +201,7 @@ typedef struct ar6_softc {
A_BOOL arWmiEnabled;
A_BOOL arWmiReady;
A_BOOL arConnected;
+ A_BOOL arRadioSwitch;
HTC_HANDLE arHtcTarget;
void *arHifDevice;
spinlock_t arLock;
diff --git a/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c b/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c
index d775e4d84b8..db749e2407c 100644
--- a/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c
+++ b/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c
@@ -649,8 +649,16 @@ ar6000_ioctl_siwtxpow(struct net_device *dev,
return -EIO;
}
- if (rrq->disabled) {
- return -EOPNOTSUPP;
+ if (ar->arRadioSwitch == WLAN_ENABLED
+ && rrq->disabled) {
+ if (wmi_switch_radio(ar->arWmi, WLAN_DISABLED) < 0)
+ return -EIO;
+ ar->arRadioSwitch = WLAN_DISABLED;
+ } else if (ar->arRadioSwitch == WLAN_DISABLED
+ && !rrq->disabled) {
+ if (wmi_switch_radio(ar->arWmi, WLAN_ENABLED) < 0)
+ return -EIO;
+ ar->arRadioSwitch = WLAN_ENABLED;
}
if (rrq->fixed) {
@@ -686,6 +694,11 @@ ar6000_ioctl_giwtxpow(struct net_device *dev,
return -EIO;
}
+ if (ar->arRadioSwitch == WLAN_DISABLED) {
+ rrq->disabled = 1;
+ return 0;
+ }
+
if (down_interruptible(&ar->arSem)) {
return -ERESTARTSYS;
}
@@ -1610,7 +1623,7 @@ ar6000_ioctl_giwrange(struct net_device *dev,
data->length = sizeof(struct iw_range);
A_MEMZERO(range, sizeof(struct iw_range));
- range->txpower_capa = 0;
+ range->txpower_capa = IW_TXPOW_DBM;
range->min_pmp = 1 * 1024;
range->max_pmp = 65535 * 1024;
diff --git a/drivers/sdio/function/wlan/ar6000/include/wmi_api.h b/drivers/sdio/function/wlan/ar6000/include/wmi_api.h
index aa9a9c6959b..267edfd0a9a 100644
--- a/drivers/sdio/function/wlan/ar6000/include/wmi_api.h
+++ b/drivers/sdio/function/wlan/ar6000/include/wmi_api.h
@@ -168,6 +168,7 @@ A_STATUS wmi_set_pmkid_list_cmd(struct wmi_t *wmip,
WMI_SET_PMKID_LIST_CMD *pmkInfo);
A_STATUS wmi_set_txPwr_cmd(struct wmi_t *wmip, A_UINT8 dbM);
A_STATUS wmi_get_txPwr_cmd(struct wmi_t *wmip);
+A_STATUS wmi_switch_radio(struct wmi_t *wmip, A_UINT8 on);
A_STATUS wmi_addBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex, A_UINT8 *bssid);
A_STATUS wmi_deleteBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex);
A_STATUS wmi_set_tkip_countermeasures_cmd(struct wmi_t *wmip, A_BOOL en);
diff --git a/drivers/sdio/function/wlan/ar6000/wmi/wmi.c b/drivers/sdio/function/wlan/ar6000/wmi/wmi.c
index 0e0e6baffd3..d322cf3f522 100644
--- a/drivers/sdio/function/wlan/ar6000/wmi/wmi.c
+++ b/drivers/sdio/function/wlan/ar6000/wmi/wmi.c
@@ -2990,6 +2990,39 @@ wmi_get_txPwr_cmd(struct wmi_t *wmip)
return (wmi_cmd_send(wmip, osbuf, WMI_GET_TX_PWR_CMDID, NO_SYNC_WMIFLAG));
}
+A_STATUS
+wmi_switch_radio(struct wmi_t *wmip, A_UINT8 on)
+{
+ WMI_SCAN_PARAMS_CMD scParams = {0, 0, 0, 0, 0,
+ WMI_SHORTSCANRATIO_DEFAULT,
+ DEFAULT_SCAN_CTRL_FLAGS,
+ 0};
+
+ if (on) {
+ /* Enable foreground scanning */
+ if (wmi_scanparams_cmd(wmip, scParams.fg_start_period,
+ scParams.fg_end_period,
+ scParams.bg_period,
+ scParams.minact_chdwell_time,
+ scParams.maxact_chdwell_time,
+ scParams.pas_chdwell_time,
+ scParams.shortScanRatio,
+ scParams.scanCtrlFlags,
+ scParams.max_dfsch_act_time) != A_OK) {
+ return -EIO;
+ }
+ } else {
+ wmi_disconnect_cmd(wmip);
+ if (wmi_scanparams_cmd(wmip, 0xFFFF, 0, 0, 0,
+ 0, 0, 0, 0xFF, 0) != A_OK) {
+ return -EIO;
+ }
+ }
+
+ return A_OK;
+}
+
+
A_UINT16
wmi_get_mapped_qos_queue(struct wmi_t *wmip, A_UINT8 trafficClass)
{