Commit 9ed9d4bf authored by Sophie Brun's avatar Sophie Brun

New upstream version 5.1.5~20180108

parent bc2218d7
......@@ -4,3 +4,8 @@ config RTL8812AU
---help---
Help message of RTL8812AU
config RTL8814AU
tristate "Realtek 8814A USB WiFi"
depends on USB
---help---
Help message of RTL8814AU
This diff is collapsed.
# RTL8812AU/21AU and RTL8814AU drivers
# with monitor mode and frame injection
## DKMS
This driver can be installed using [DKMS]. This is a system which will automatically recompile and install a kernel module when a new kernel gets installed or updated. To make use of DKMS, install the `dkms` package, which on Debian (based) systems is done like this:
```
......@@ -29,11 +28,50 @@ make install
and for building & installing the RTL8814AU driver with 'make' use
```
make RTL8814=1
make install 8814au
make install RTL8814=1
```
## Notes
For Ubuntu 17.04 add the following lines
Download
```
git clone -b v5.1.5 https://github.com/aircrack-ng/rtl8812au.git
cd rtl*
```
Package / Build dependencies
```
sudo apt-get install build-essential
sudo apt-get install bc
sudo apt-get install linux-headers-`uname -r`
```
For setting monitor mode
1. Fix problematic interference in monitor mode.
```
airmon-ng check kill
```
You may also uncheck the box "Automatically connect to this network when it is avaiable" in nm-connection-editor. This only works if you have a saved wifi connection.
2. Set interface down
```
sudo ip link set wlan0 down
```
3. Set monitor mode
```
sudo iw dev wlan0 set type monitor
```
4. Set interface up
```
sudo ip link set wlan0 up
```
For setting TX power
```
sudo iwconfig wlan0 txpower 30
```
or
```
sudo iw wlan0 set txpower fixed 3000
```
Newer versions of NetworkManager switches to random MAC address. Some users would prefer to use a fixed address.
Simply add these lines below
```
[device]
wifi.scan-rand-mac-address=no
......@@ -41,3 +79,21 @@ wifi.scan-rand-mac-address=no
at the end of file /etc/NetworkManager/NetworkManager.conf and restart NetworkManager with the command:
```
sudo service NetworkManager restart
```
## LED Parameter
```
We've added the "realtek-leds.conf" in build directory,
with this you may change the leds to
"2: Allways On", "1: Normal" or "0: Allways Off" with placing the file in "/etc/modprobe.d/
Manual modprobe will override this file if option value also included at the command line, e.g.,
$ sudo modprobe -r 8812au
$ sudo modprobe 8812au rtw_led_ctrl=1
```
## Credits
```
astsam - for the main work + monitor/injection support - https://github.com/astsam
evilphish - for great patching (USB3, VHT + txpower control +++) - https://github.com/evilphish
```
#!/bin/bash
rmmod 8192cu
rmmod 8192ce
rmmod 8192du
rmmod 8192de
......@@ -337,6 +337,61 @@ u16 rtw_get_efuse_mask_arraylen(PADAPTER pAdapter)
}
VOID efuse_PreUpdateAction(
PADAPTER pAdapter,
pu4Byte BackupRegs)
{
if (IS_HARDWARE_TYPE_8812AU(pAdapter)) {
/* <20131115, Kordan> Turn off Rx to prevent from being busy when writing the EFUSE. (Asked by Chunchu.)*/
BackupRegs[0] = PHY_QueryMacReg(pAdapter, REG_RCR, bMaskDWord);
BackupRegs[1] = PHY_QueryMacReg(pAdapter, REG_RXFLTMAP0, bMaskDWord);
BackupRegs[2] = PHY_QueryMacReg(pAdapter, REG_RXFLTMAP0+4, bMaskDWord);
BackupRegs[3] = PHY_QueryMacReg(pAdapter, REG_AFE_MISC, bMaskDWord);
PlatformEFIOWrite4Byte(pAdapter, REG_RCR, 0x1);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0, 0);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+1, 0);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+2, 0);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+3, 0);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+4, 0);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+5, 0);
/* <20140410, Kordan> 0x11 = 0x4E, lower down LX_SPS0 voltage. (Asked by Chunchu)*/
PHY_SetMacReg(pAdapter, REG_AFE_MISC, bMaskByte1, 0x4E);
}
if (IS_HARDWARE_TYPE_8814AU(pAdapter)) {
/* <20131115, Kordan> Turn off Rx to prevent from being busy when writing the EFUSE. (Asked by Chunchu.)*/
BackupRegs[0] = PHY_QueryMacReg(pAdapter, REG_RCR, bMaskDWord);
BackupRegs[1] = PHY_QueryMacReg(pAdapter, REG_RXFLTMAP0, bMaskDWord);
BackupRegs[2] = PHY_QueryMacReg(pAdapter, REG_RXFLTMAP0+4, bMaskDWord);
BackupRegs[3] = PHY_QueryMacReg(pAdapter, REG_AFE_MISC, bMaskDWord);
PlatformEFIOWrite4Byte(pAdapter, REG_RCR, 0x1);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0, 0);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+1, 0);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+2, 0);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+3, 0);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+4, 0);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+5, 0);
/* <20140410, Kordan> 0x11 = 0x4E, lower down LX_SPS0 voltage. (Asked by Chunchu)*/
PHY_SetMacReg(pAdapter, REG_AFE_MISC, bMaskByte1, 0x4E);
}
}
VOID efuse_PostUpdateAction(
PADAPTER pAdapter,
pu4Byte BackupRegs)
{
if (IS_HARDWARE_TYPE_8812AU(pAdapter)) {
/* <20131115, Kordan> Turn on Rx and restore the registers. (Asked by Chunchu.)*/
PHY_SetMacReg(pAdapter, REG_RCR, bMaskDWord, BackupRegs[0]);
PHY_SetMacReg(pAdapter, REG_RXFLTMAP0, bMaskDWord, BackupRegs[1]);
PHY_SetMacReg(pAdapter, REG_RXFLTMAP0+4, bMaskDWord, BackupRegs[2]);
PHY_SetMacReg(pAdapter, REG_AFE_MISC, bMaskDWord, BackupRegs[3]);
}
}
#ifdef RTW_HALMAC
#include "../../hal/hal_halmac.h"
......@@ -386,7 +441,6 @@ void EFUSE_GetEfuseDefinition(PADAPTER adapter, u8 efusetype, u8 type, void *out
struct dvobj_priv *d;
u32 v32 = 0;
d = adapter_to_dvobj(adapter);
if (adapter->HalFunc.EFUSEGetEfuseDefinition) {
......@@ -414,7 +468,6 @@ u8 rtw_efuse_access(PADAPTER adapter, u8 write, u16 addr, u16 cnts, u8 *data)
u32 size, i;
int err;
d = adapter_to_dvobj(adapter);
err = rtw_halmac_get_physical_efuse_size(d, &size);
if (err)
......@@ -715,7 +768,6 @@ VOID hal_ReadEFuse_BT_logic_map(
u16 i, total, used;
u8 efuse_usage;
/* */
/* Do NOT excess total size of EFuse table. Added by Roger, 2008.11.10. */
/* */
......@@ -830,7 +882,6 @@ exit:
rtw_mfree(efuseTbl, EFUSE_BT_MAP_LEN);
}
static u8 hal_EfusePartialWriteCheck(
PADAPTER padapter,
u8 efuseType,
......@@ -873,7 +924,6 @@ static u8 hal_EfusePartialWriteCheck(
return bRet;
}
static u8 hal_EfusePgPacketWrite2ByteHeader(
PADAPTER padapter,
u8 efuseType,
......@@ -940,7 +990,6 @@ static u8 hal_EfusePgPacketWrite2ByteHeader(
return _TRUE;
}
static u8 hal_EfusePgPacketWrite1ByteHeader(
PADAPTER pAdapter,
u8 efuseType,
......@@ -953,7 +1002,6 @@ static u8 hal_EfusePgPacketWrite1ByteHeader(
u16 efuse_addr = *pAddr;
u8 repeatcnt = 0;
/* RTW_INFO("%s\n", __FUNCTION__); */
pg_header = ((pTargetPkt->offset << 4) & 0xf0) | pTargetPkt->word_en;
......@@ -996,7 +1044,6 @@ static u8 hal_EfusePgPacketWriteHeader(
return bRet;
}
static u8
Hal_EfuseWordEnableDataWrite(
PADAPTER padapter,
......@@ -1010,7 +1057,6 @@ Hal_EfuseWordEnableDataWrite(
u8 badworden = 0x0F;
u8 tmpdata[PGPKT_DATA_SIZE];
/* RTW_INFO("%s: efuse_addr=%#x word_en=%#x\n", __FUNCTION__, efuse_addr, word_en); */
_rtw_memset(tmpdata, 0xFF, PGPKT_DATA_SIZE);
......@@ -1116,7 +1162,6 @@ u8 EfusePgPacketWrite_BT(
return _TRUE;
}
#else /* !RTW_HALMAC */
/* ------------------------------------------------------------------------------ */
#define REG_EFUSE_CTRL 0x0030
......@@ -1469,7 +1514,6 @@ EFUSE_Write1Byte(
}
} /* EFUSE_Write1Byte */
/* 11/16/2008 MH Read one byte from real Efuse. */
u8
efuse_OneByteRead(
......@@ -1555,7 +1599,6 @@ efuse_OneByteWrite(
/* -----------------e-fuse reg ctrl --------------------------------- */
/* address */
efuseValue = rtw_read32(pAdapter, EFUSE_CTRL);
efuseValue |= (BIT21 | BIT31);
efuseValue &= ~(0x3FFFF);
......@@ -1574,6 +1617,8 @@ efuse_OneByteWrite(
} else
rtw_write32(pAdapter, EFUSE_CTRL, efuseValue);
rtw_mdelay_os(1);
while ((0x80 & rtw_read8(pAdapter, EFUSE_CTRL + 3)) && (tmpidx < 100)) {
rtw_mdelay_os(1);
tmpidx++;
......@@ -1627,7 +1672,6 @@ Efuse_PgPacketWrite(IN PADAPTER pAdapter,
return ret;
}
int
Efuse_PgPacketWrite_BT(IN PADAPTER pAdapter,
IN u8 offset,
......@@ -1642,7 +1686,6 @@ Efuse_PgPacketWrite_BT(IN PADAPTER pAdapter,
return ret;
}
u8
Efuse_WordEnableDataWrite(IN PADAPTER pAdapter,
IN u16 efuse_addr,
......@@ -1676,6 +1719,9 @@ u8 rtw_efuse_access(PADAPTER padapter, u8 bWrite, u16 start_addr, u16 cnts, u8 *
u16 real_content_len = 0, max_available_size = 0;
u8 res = _FAIL ;
u8(*rw8)(PADAPTER, u16, u8 *);
u32 backupRegs[4] = {0};
efuse_PreUpdateAction(padapter, backupRegs);
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_REAL_CONTENT_LEN, (PVOID)&real_content_len, _FALSE);
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (PVOID)&max_available_size, _FALSE);
......@@ -1706,6 +1752,8 @@ u8 rtw_efuse_access(PADAPTER padapter, u8 bWrite, u16 start_addr, u16 cnts, u8 *
Efuse_PowerSwitch(padapter, bWrite, _FALSE);
efuse_PostUpdateAction(padapter, backupRegs);
return res;
}
/* ------------------------------------------------------------------------------ */
......@@ -1797,8 +1845,11 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
s32 i, j, idx;
u8 ret = _SUCCESS;
u16 mapLen = 0;
u32 backupRegs[4] = {0};
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
efuse_PreUpdateAction(padapter, backupRegs);
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, (PVOID)&mapLen, _FALSE);
if ((addr + cnts) > mapLen)
......@@ -1871,6 +1922,7 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
/*Efuse_PowerSwitch(padapter, _TRUE, _FALSE);*/
exit:
efuse_PostUpdateAction(padapter, backupRegs);
rtw_mfree(map, mapLen);
......@@ -2087,7 +2139,6 @@ efuse_ShadowRead4Byte(
} /* efuse_ShadowRead4Byte */
/*-----------------------------------------------------------------------------
* Function: efuse_ShadowWrite1Byte
* efuse_ShadowWrite2Byte
......@@ -2135,7 +2186,6 @@ efuse_ShadowWrite2Byte(
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(pAdapter);
pHalData->efuse_eeprom_data[Offset] = Value & 0x00FF;
pHalData->efuse_eeprom_data[Offset + 1] = Value >> 8;
......@@ -2157,7 +2207,6 @@ efuse_ShadowWrite4Byte(
} /* efuse_ShadowWrite1Byte */
/*-----------------------------------------------------------------------------
* Function: EFUSE_ShadowRead
*
......@@ -2225,7 +2274,6 @@ EFUSE_ShadowWrite(
if (pAdapter->registrypriv.mp_mode == 0)
return;
if (Type == 1)
efuse_ShadowWrite1Byte(pAdapter, Offset, (u8)Value);
else if (Type == 2)
......@@ -2344,7 +2392,6 @@ void EFUSE_ShadowMapUpdate(
u8 *efuse_map = NULL;
int err;
mapLen = EEPROM_MAX_SIZE;
efuse_map = pHalData->efuse_eeprom_data;
/* efuse default content is 0xFF */
......@@ -2566,7 +2613,11 @@ u32 rtw_read_efuse_from_file(const char *path, u8 *buf)
set_fs(KERNEL_DS);
for (i = 0 ; i < HWSET_MAX_SIZE ; i++) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
kernel_read(fp, temp, 2, &pos);
#else
vfs_read(fp, temp, 2, &pos);
#endif
if (sscanf(temp, "%hhx", &buf[i]) != 1) {
if (0)
RTW_ERR("%s sscanf fail\n", __func__);
......@@ -2574,10 +2625,18 @@ u32 rtw_read_efuse_from_file(const char *path, u8 *buf)
}
if ((i % EFUSE_FILE_COLUMN_NUM) == (EFUSE_FILE_COLUMN_NUM - 1)) {
/* Filter the lates space char. */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
kernel_read(fp, temp, 1, &pos);
#else
vfs_read(fp, temp, 1, &pos);
#endif
if (strchr(temp, ' ') == NULL) {
pos--;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
kernel_read(fp, temp, 2, &pos);
#else
vfs_read(fp, temp, 2, &pos);
#endif
}
} else {
pos += 1; /* Filter the space character */
......@@ -2634,7 +2693,11 @@ u32 rtw_read_macaddr_from_file(const char *path, u8 *buf)
fs = get_fs();
set_fs(KERNEL_DS);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
kernel_read(fp, source_addr, 18, &pos);
#else
vfs_read(fp, source_addr, 18, &pos);
#endif
source_addr[17] = ':';
head = end = source_addr;
......
......@@ -3567,6 +3567,25 @@ void start_ap_mode(_adapter *padapter)
}
void rtw_ap_bcmc_sta_flush(_adapter *padapter)
{
#ifdef CONFIG_CONCURRENT_MODE
int cam_id = -1;
u8 *addr = adapter_mac_addr(padapter);
cam_id = rtw_iface_bcmc_id_get(padapter);
if (cam_id != INVALID_SEC_MAC_CAM_ID) {
RTW_PRINT("clear group key for "ADPT_FMT" addr:"MAC_FMT", camid:%d\n",
ADPT_ARG(padapter), MAC_ARG(addr), cam_id);
clear_cam_entry(padapter, cam_id);
rtw_camid_free(padapter, cam_id);
rtw_iface_bcmc_id_set(padapter, INVALID_SEC_MAC_CAM_ID); /*init default value*/
}
#else
invalidate_cam_all(padapter);
#endif
}
void stop_ap_mode(_adapter *padapter)
{
_irqL irqL;
......@@ -3599,6 +3618,7 @@ void stop_ap_mode(_adapter *padapter)
#endif
rtw_sta_flush(padapter, _TRUE);
rtw_ap_bcmc_sta_flush(padapter);
/* free_assoc_sta_resources */
rtw_free_all_stainfo(padapter);
......
This diff is collapsed.
......@@ -47,7 +47,6 @@ const char *rtw_log_level_str[] = {
void dump_drv_version(void *sel)
{
RTW_PRINT_SEL(sel, "%s %s\n", DRV_NAME, DRIVERVERSION);
RTW_PRINT_SEL(sel, "build time: %s %s\n", __DATE__, __TIME__);
}
void dump_drv_cfg(void *sel)
......
......@@ -1379,7 +1379,7 @@ extern char *rtw_initmac;
*/
void rtw_macaddr_cfg(u8 *out, const u8 *hw_mac_addr)
{
#define DEFAULT_RANDOM_MACADDR 1
#define DEFAULT_RANDOM_MACADDR 0
u8 mac[ETH_ALEN];
if (out == NULL) {
......@@ -1422,9 +1422,9 @@ err_chk:
mac[0] = 0x00;
mac[1] = 0xe0;
mac[2] = 0x4c;
mac[3] = 0x87;
mac[4] = 0x00;
mac[5] = 0x00;
mac[3] = 0xe0;
mac[4] = 0x10;
mac[5] = 0x70;
#endif
}
......
......@@ -1279,13 +1279,6 @@ void rtw_surveydone_event_callback(_adapter *adapter, u8 *pbuf)
|| _SUCCESS != rtw_sitesurvey_cmd(adapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)
) {
rtw_set_to_roam(adapter, 0);
#ifdef CONFIG_INTEL_WIDI
if (adapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) {
_rtw_memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN);
intel_widi_wk_cmd(adapter, INTEL_WIDI_LISTEN_WK, NULL, 0);
RTW_INFO("change to widi listen\n");
}
#endif /* CONFIG_INTEL_WIDI */
rtw_free_assoc_resources(adapter, 1);
rtw_indicate_disconnect(adapter, 0, _FALSE);
} else
......@@ -1515,20 +1508,12 @@ void rtw_indicate_connect(_adapter *padapter)
}
rtw_set_to_roam(padapter, 0);
#ifdef CONFIG_INTEL_WIDI
if (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) {
_rtw_memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN);
intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_WK, NULL, 0);
RTW_INFO("change to widi listen\n");
}
#endif /* CONFIG_INTEL_WIDI */
if (!check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE))
rtw_mi_set_scan_deny(padapter, 3000);
}
/*
*rtw_indicate_disconnect: the caller has to lock pmlmepriv->lock
*/
......@@ -2442,10 +2427,6 @@ void rtw_stadel_event_callback(_adapter *adapter, u8 *pbuf)
roam = _TRUE;
roam_target = pmlmepriv->roam_network;
}
#ifdef CONFIG_INTEL_WIDI
else if (adapter->mlmepriv.widi_state == INTEL_WIDI_STATE_CONNECTED)
roam = _TRUE;
#endif /* CONFIG_INTEL_WIDI */
if (roam == _TRUE) {
if (rtw_to_roam(adapter) > 0)
......@@ -2471,10 +2452,6 @@ void rtw_stadel_event_callback(_adapter *adapter, u8 *pbuf)
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
rtw_indicate_disconnect(adapter, *(u16 *)pstadel->rsvd, pstadel->locally_generated);
#ifdef CONFIG_INTEL_WIDI
if (!rtw_to_roam(adapter))
process_intel_widi_disconnect(adapter, 1);
#endif /* CONFIG_INTEL_WIDI */
_rtw_roaming(adapter, roam_target);
}
......@@ -2593,13 +2570,6 @@ void _rtw_join_timeout_handler(_adapter *adapter)
}
break;
} else {
#ifdef CONFIG_INTEL_WIDI
if (adapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) {
_rtw_memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN);
intel_widi_wk_cmd(adapter, INTEL_WIDI_LISTEN_WK, NULL, 0);
RTW_INFO("change to widi listen\n");
}
#endif /* CONFIG_INTEL_WIDI */
RTW_INFO("%s We've try roaming but fail\n", __FUNCTION__);
rtw_indicate_disconnect(adapter, 0, _FALSE);
break;
......
......@@ -5645,9 +5645,6 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da)
#ifdef CONFIG_WFD
u32 wfdielen = 0;
#endif
#ifdef CONFIG_INTEL_WIDI
u8 zero_array_check[L2SDTA_SERVICE_VE_LEN] = { 0x00 };
#endif /* CONFIG_INTEL_WIDI */
/* RTW_INFO("%s\n", __FUNCTION__); */
......@@ -5749,39 +5746,6 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da)
/* Value: */
wpsie[wpsielen++] = WPS_VERSION_1; /* Version 1.0 */
#ifdef CONFIG_INTEL_WIDI
/* Commented by Kurt */
/* Appended WiDi info. only if we did issued_probereq_widi(), and then we saved ven. ext. in pmlmepriv->sa_ext. */
if (_rtw_memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == _FALSE
|| pmlmepriv->num_p2p_sdt != 0) {
/* Sec dev type */
*(u16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_ATTR_SEC_DEV_TYPE_LIST);
wpsielen += 2;
/* Length: */
*(u16 *)(wpsie + wpsielen) = cpu_to_be16(0x0008);
wpsielen += 2;
/* Value: */
/* Category ID */
*(u16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_PDT_CID_DISPLAYS);
wpsielen += 2;
/* OUI */
*(u32 *)(wpsie + wpsielen) = cpu_to_be32(INTEL_DEV_TYPE_OUI);
wpsielen += 4;
*(u16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_PDT_SCID_WIDI_CONSUMER_SINK);
wpsielen += 2;
if (_rtw_memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == _FALSE) {
/* Vendor Extension */
_rtw_memcpy(wpsie + wpsielen, pmlmepriv->sa_ext, L2SDTA_SERVICE_VE_LEN);
wpsielen += L2SDTA_SERVICE_VE_LEN;
}
}
#endif /* CONFIG_INTEL_WIDI */
/* WiFi Simple Config State */
/* Type: */
*(u16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_ATTR_SIMPLE_CONF_STATE);
......@@ -6406,13 +6370,6 @@ unsigned int on_action_public_p2p(union recv_frame *precv_frame)
result = process_p2p_group_negotation_req(pwdinfo, frame_body, len);
issue_p2p_GO_response(padapter, GetAddr2Ptr(pframe), frame_body, len, result);
#ifdef CONFIG_INTEL_WIDI
if (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_LISTEN) {
padapter->mlmepriv.widi_state = INTEL_WIDI_STATE_WFD_CONNECTION;
_cancel_timer_ex(&(padapter->mlmepriv.listen_timer));
intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_STOP_WK, NULL, 0);
}
#endif /* CONFIG_INTEL_WIDI */
/* Commented by Albert 20110718 */
/* No matter negotiating or negotiation failure, the driver should set up the restore P2P state timer. */
......@@ -6564,11 +6521,6 @@ unsigned int on_action_public_p2p(union recv_frame *precv_frame)
}
} else {
rtw_p2p_set_state(pwdinfo, P2P_STATE_RECV_INVITE_REQ_DISMATCH);
#ifdef CONFIG_INTEL_WIDI
_rtw_memcpy(pwdinfo->p2p_peer_device_addr, group_id.go_device_addr , ETH_ALEN);
rtw_p2p_set_role(pwdinfo, P2P_ROLE_CLIENT);
#endif /* CONFIG_INTEL_WIDI */
status_code = P2P_STATUS_FAIL_UNKNOWN_P2PGROUP;
}
}
......@@ -6614,13 +6566,6 @@ unsigned int on_action_public_p2p(union recv_frame *precv_frame)
issue_p2p_invitation_response(padapter, GetAddr2Ptr(pframe), pwdinfo->inviteresp_info.token, status_code);
_set_timer(&pwdinfo->restore_p2p_state_timer, 3000);
}
#ifdef CONFIG_INTEL_WIDI
if (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_LISTEN) {
padapter->mlmepriv.widi_state = INTEL_WIDI_STATE_WFD_CONNECTION;
_cancel_timer_ex(&(padapter->mlmepriv.listen_timer));
intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_STOP_WK, NULL, 0);
}
#endif /* CONFIG_INTEL_WIDI */
break;
}
case P2P_INVIT_RESP: {
......@@ -6685,13 +6630,6 @@ unsigned int on_action_public_p2p(union recv_frame *precv_frame)
rtw_p2p_set_state(pwdinfo, P2P_STATE_RX_PROVISION_DIS_REQ);
_set_timer(&pwdinfo->restore_p2p_state_timer, P2P_PROVISION_TIMEOUT);
#ifdef CONFIG_INTEL_WIDI
if (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_LISTEN) {
padapter->mlmepriv.widi_state = INTEL_WIDI_STATE_WFD_CONNECTION;
_cancel_timer_ex(&(padapter->mlmepriv.listen_timer));
intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_STOP_WK, NULL, 0);
}
#endif /* CONFIG_INTEL_WIDI */
break;
case P2P_PROVISION_DISC_RESP:
......@@ -10500,12 +10438,6 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI
}
#ifdef CONFIG_INTEL_WIDI
/* process_intel_widi_query_or_tigger(padapter, bssid); */
if (process_intel_widi_query_or_tigger(padapter, bssid))
return _FAIL;
#endif /* CONFIG_INTEL_WIDI */
#if defined(DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED) & 1
if (strcmp(bssid->Ssid.Ssid, DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED) == 0) {
RTW_INFO("Receiving %s("MAC_FMT", DSConfig:%u) from ch%u with ss:%3u, sq:%3u, RawRSSI:%3ld\n"
......
......@@ -1867,16 +1867,6 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
{
u8 p2pie[MAX_P2P_IE_LEN] = { 0x00 };
u32 len = 0, p2pielen = 0;
#ifdef CONFIG_INTEL_WIDI
struct mlme_priv *pmlmepriv = &(pwdinfo->padapter->mlmepriv);
u8 zero_array_check[L2SDTA_SERVICE_VE_LEN] = { 0x00 };
u8 widi_version = 0, i = 0;
if (_rtw_memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == _FALSE)
widi_version = 35;
else if (pmlmepriv->num_p2p_sdt != 0)
widi_version = 40;
#endif /* CONFIG_INTEL_WIDI */
/* P2P OUI */
p2pielen = 0;
......@@ -1959,13 +1949,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* 21->P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) */
/* + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) */
/* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); */
#ifdef CONFIG_INTEL_WIDI
if (widi_version == 35)
RTW_PUT_LE16(p2pie + p2pielen, 21 + 8 + pwdinfo->device_name_len);
else if (widi_version == 40)
RTW_PUT_LE16(p2pie + p2pielen, 21 + 8 * pmlmepriv->num_p2p_sdt + pwdinfo->device_name_len);
else
#endif /* CONFIG_INTEL_WIDI */
RTW_PUT_LE16(p2pie + p2pielen, 21 + pwdinfo->device_name_len);
p2pielen += 2;
......@@ -1980,25 +1964,6 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
RTW_PUT_BE16(p2pie + p2pielen, pwdinfo->supported_wps_cm);
p2pielen += 2;
#ifdef CONFIG_INTEL_WIDI
if (widi_version == 40) {
/* Primary Device Type */
/* Category ID */
/* *(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); */
RTW_PUT_BE16(p2pie + p2pielen, pmlmepriv->p2p_pdt_cid);
p2pielen += 2;
/* OUI */
/* *(u32*) ( p2pie + p2pielen ) = cpu_to_be32( WPSOUI ); */
RTW_PUT_BE32(p2pie + p2pielen, WPSOUI);
p2pielen += 4;
/* Sub Category ID */
/* *(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); */
RTW_PUT_BE16(p2pie + p2pielen, pmlmepriv->p2p_pdt_scid);
p2pielen += 2;
} else
#endif /* CONFIG_INTEL_WIDI */
{
/* Primary Device Type */
/* Category ID */
......@@ -2018,32 +1983,6 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
}
/* Number of Secondary Device Types */
#ifdef CONFIG_INTEL_WIDI
if (widi_version == 35) {
p2pie[p2pielen++] = 0x01;
RTW_PUT_BE16(p2pie + p2pielen, WPS_PDT_CID_DISPLAYS);
p2pielen += 2;
RTW_PUT_BE32(p2pie + p2pielen, INTEL_DEV_TYPE_OUI);
p2pielen += 4;
RTW_PUT_BE16(p2pie + p2pielen, P2P_SCID_WIDI_CONSUMER_SINK);
p2pielen += 2;
} else if (widi_version == 40) {
p2pie[p2pielen++] = pmlmepriv->num_p2p_sdt;
for (; i < pmlmepriv->num_p2p_sdt; i++) {
RTW_PUT_BE16(p2pie + p2pielen, pmlmepriv->p2p_sdt_cid[i]);
p2pielen += 2;
RTW_PUT_BE32(p2pie + p2pielen, INTEL_DEV_TYPE_OUI);
p2pielen += 4;