aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/rt2860/sta_ioctl.c
diff options
context:
space:
mode:
authorAdam McDaniel <adam@array.org>2009-02-23 08:01:07 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-04-03 14:53:31 -0700
commited291e8051ee418de7ccd3507c1e783323fd1c35 (patch)
treec8df539e5170a8c877181db9b86312a94e33041f /drivers/staging/rt2860/sta_ioctl.c
parentf4b44e763d1bd1dd00213c1e5820a594b55122dc (diff)
Staging: rt2860: Ported v1.7.1.1 changes into v1.8.0.0, becoming v1.8.1.1
Staging: rt2860: Ported v1.7.1.1 changes into v1.8.0.0, becoming v1.8.1.1 When RaLink released rt2860 v1.7.0.0, it lacked proper support for both WEP and WPA/WPA2 encryption. Either was possible, but the module had to be compiled to support only one or the other, never both. Since the EeePC was the most common device with this hardware (and these users were complaining to RaLink that WPA/WPA2 encryption didn't work) RaLink released a fix as an "eeepc-specific" version of this driver, v1.7.1.1 Unfortunately, when v1.8.0.0 was released, this WPA/WPA2 fix was never included. What complicates things further is that RaLink has no interest in continuing work on this Linux driver for their hardware. This commit ports the changes introduced in v1.7.1.1 into the v1.8.0.0 release, upgrading the kernel's module to v1.8.1.1 Signed-off-by: Adam McDaniel <adam@array.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rt2860/sta_ioctl.c')
-rw-r--r--drivers/staging/rt2860/sta_ioctl.c80
1 files changed, 73 insertions, 7 deletions
diff --git a/drivers/staging/rt2860/sta_ioctl.c b/drivers/staging/rt2860/sta_ioctl.c
index c11eeabe660..320d9b2046b 100644
--- a/drivers/staging/rt2860/sta_ioctl.c
+++ b/drivers/staging/rt2860/sta_ioctl.c
@@ -352,6 +352,20 @@ VOID RTMPAddKey(
DBGPRINT(RT_DEBUG_TRACE, ("RTMPAddKey ------>\n"));
+ RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
+ if (RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND))
+ {
+ if (pAd->StaCfg.bRadio == FALSE)
+ {
+ RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
+ return (NDIS_STATUS_SUCCESS);
+ }
+ DBGPRINT(RT_DEBUG_TRACE,("RTMPWPAAddKeyProc1==>\n"));
+ RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_HALT);
+ RTMPusecDelay(6000);
+ pAd->bPCIclkOff = FALSE;
+ }
+
if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
{
if (pKey->KeyIndex & 0x80000000)
@@ -545,6 +559,8 @@ VOID RTMPAddKey(
}
}
end:
+ RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
+ DBGPRINT(RT_DEBUG_INFO, ("<------ RTMPAddKey\n"));
return;
}
@@ -1028,6 +1044,15 @@ int rt_ioctl_siwscan(struct net_device *dev,
return -EINVAL;
}
+ if ((pAdapter->OpMode == OPMODE_STA) && (IDLE_ON(pAdapter))
+ && (pAdapter->StaCfg.bRadio == TRUE)
+ && (RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_IDLE_RADIO_OFF)))
+ {
+ RT28xxPciAsicRadioOn(pAdapter, GUI_IDLE_POWER_SAVE);
+ }
+ // Check if still radio off.
+ else if (pAdapter->bPCIclkOff == TRUE)
+ return 0;
#ifdef WPA_SUPPLICANT_SUPPORT
if (pAdapter->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_ENABLE)
@@ -2151,12 +2176,6 @@ rt_private_show(struct net_device *dev, struct iw_request_info *info,
wrq->length = strlen(extra) + 1; // 1: size of '\0'
break;
case RAIO_ON:
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
- {
- sprintf(extra, "Scanning\n");
- wrq->length = strlen(extra) + 1; // 1: size of '\0'
- break;
- }
pAd->StaCfg.bSwRadio = TRUE;
//if (pAd->StaCfg.bRadio != (pAd->StaCfg.bHwRadio && pAd->StaCfg.bSwRadio))
{
@@ -2440,6 +2459,20 @@ void fnSetCipherKey(
IN BOOLEAN bGTK,
IN struct iw_encode_ext *ext)
{
+ RTMP_CLEAR_PSFLAG(pAdapter, fRTMP_PS_CAN_GO_SLEEP);
+ if (RTMP_TEST_PSFLAG(pAdapter, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND))
+ {
+ if (pAdapter->StaCfg.bRadio == FALSE)
+ {
+ RTMP_SET_PSFLAG(pAdapter, fRTMP_PS_CAN_GO_SLEEP);
+ return (NDIS_STATUS_SUCCESS);
+ }
+ DBGPRINT(RT_DEBUG_TRACE,("RTMPWPAAddKeyProc1==>\n"));
+ RTMPPCIeLinkCtrlValueRestore(pAdapter, RESTORE_HALT);
+ RTMPusecDelay(6000);
+ pAdapter->bPCIclkOff = FALSE;
+ }
+
NdisZeroMemory(&pAdapter->SharedKey[BSS0][keyIdx], sizeof(CIPHER_KEY));
pAdapter->SharedKey[BSS0][keyIdx].KeyLen = LEN_TKIP_EK;
NdisMoveMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, ext->key, LEN_TKIP_EK);
@@ -2470,6 +2503,8 @@ void fnSetCipherKey(
keyIdx,
pAdapter->SharedKey[BSS0][keyIdx].CipherAlg,
&pAdapter->MacTab.Content[BSSID_WCID]);
+
+ RTMP_SET_PSFLAG(pAdapter, fRTMP_PS_CAN_GO_SLEEP);
}
int rt_ioctl_siwencodeext(struct net_device *dev,
@@ -2534,6 +2569,21 @@ int rt_ioctl_siwencodeext(struct net_device *dev,
NdisZeroMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, 16);
NdisMoveMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, ext->key, ext->key_len);
+
+ if (pAdapter->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled ||
+ pAdapter->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
+ {
+ // Set Group key material to Asic
+ AsicAddSharedKeyEntry(pAdapter, BSS0, keyIdx, pAdapter->SharedKey[BSS0][keyIdx].CipherAlg, pAdapter->SharedKey[BSS0][keyIdx].Key, NULL, NULL);
+
+ // Update WCID attribute table and IVEIV table for this group key table
+ RTMPAddWcidAttributeEntry(pAdapter, BSS0, keyIdx, pAdapter->SharedKey[BSS0][keyIdx].CipherAlg, NULL);
+
+ STA_PORT_SECURED(pAdapter);
+
+ // Indicate Connected for GUI
+ pAdapter->IndicateMediaState = NdisMediaStateConnected;
+ }
break;
case IW_ENCODE_ALG_TKIP:
DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_ENCODE_ALG_TKIP - keyIdx = %d, ext->key_len = %d\n", __func__, keyIdx, ext->key_len));
@@ -4249,7 +4299,23 @@ INT RTMPSetInformation(
}
#ifdef WPA_SUPPLICANT_SUPPORT
- if (pAdapter->StaCfg.PortSecured == WPA_802_1X_PORT_SECURED)
+ if ((pAdapter->StaCfg.WpaSupplicantUP != 0) &&
+ (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA))
+ {
+ Key = pWepKey->KeyMaterial;
+
+ // Set Group key material to Asic
+ AsicAddSharedKeyEntry(pAdapter, BSS0, KeyIdx, CipherAlg, Key, NULL, NULL);
+
+ // Update WCID attribute table and IVEIV table for this group key table
+ RTMPAddWcidAttributeEntry(pAdapter, BSS0, KeyIdx, CipherAlg, NULL);
+
+ STA_PORT_SECURED(pAdapter);
+
+ // Indicate Connected for GUI
+ pAdapter->IndicateMediaState = NdisMediaStateConnected;
+ }
+ else if (pAdapter->StaCfg.PortSecured == WPA_802_1X_PORT_SECURED)
#endif // WPA_SUPPLICANT_SUPPORT
{
Key = pAdapter->SharedKey[BSS0][KeyIdx].Key;