WILC_P2P is always used in the driver. So delete define WILC_P2P and ifdef line.
Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
/* Get the cap_info */
pstrNetworkInfo->u16CapInfo = get_cap_info(pu8msa);
- #ifdef WILC_P2P
/* Get time-stamp [Low only 32 bit] */
pstrNetworkInfo->u32Tsf = get_beacon_timestamp_lo(pu8msa);
PRINT_D(CORECONFIG_DBG, "TSF :%x\n", pstrNetworkInfo->u32Tsf);
- #endif
/* Get full time-stamp [Low and High 64 bit] */
u32Tsf_Lo = get_beacon_timestamp_lo(pu8msa);
#ifdef AGING_ALG
u8 u8Found;
#endif
-#ifdef WILC_P2P
u32 u32Tsf; /* time-stamp [Low only 32 bit] */
-#endif
u8 *pu8IEs;
u16 u16IEsLen;
void *pJoinParams;
tstrHostIfSetMacAddress strHostIfSetMacAddress;
tstrHostIfGetMacAddress strHostIfGetMacAddress;
tstrHostIfBASessionInfo strHostIfBASessionInfo;
- #ifdef WILC_P2P
tstrHostIfRemainOnChan strHostIfRemainOnChan;
tstrHostIfRegisterFrame strHostIfRegisterFrame;
- #endif
char *pUserData;
tstrHostIFDelAllSta strHostIFDelAllSta;
} tuniHostIFmsgBody;
u8 rsn_auth_policy[3];
u8 rsn_cap[2];
struct _tstrJoinParam *nextJoinBss;
- #ifdef WILC_P2P
u32 tsf;
u8 u8NoaEnbaled;
u8 u8OppEnable;
u8 au8Duration[4];
u8 au8Interval[4];
u8 au8StartTime[4];
- #endif
} tstrJoinBssParam;
/*Bug4218: Parsing Join Param*/
/*a linked list table containing needed join parameters entries for each AP found in most recent scan*/
pstrWFIDrv->strWILC_UsrScanReq.pfUserScanResult = pstrHostIFscanAttr->pfScanResult;
pstrWFIDrv->strWILC_UsrScanReq.u32UserScanPvoid = pstrHostIFscanAttr->pvUserArg;
- #ifdef WILC_P2P
- #endif
-
if ((pstrWFIDrv->enuHostIFstate >= HOST_IF_SCANNING) && (pstrWFIDrv->enuHostIFstate < HOST_IF_CONNECTED)) {
/* here we either in HOST_IF_SCANNING, HOST_IF_WAITING_CONN_REQ or HOST_IF_WAITING_CONN_RESP */
PRINT_D(GENERIC_DBG, "Don't scan we are already in [%d] state\n", pstrWFIDrv->enuHostIFstate);
/*BugID_5137*/
*(pu8CurrByte++) = REAL_JOIN_REQ;
- #ifdef WILC_P2P
*(pu8CurrByte++) = ptstrJoinBssParam->u8NoaEnbaled;
if (ptstrJoinBssParam->u8NoaEnbaled) {
PRINT_D(HOSTINF_DBG, "NOA present\n");
} else
PRINT_D(HOSTINF_DBG, "NOA not present\n");
- #endif
-
/* keep the buffer at the start of the allocated pointer to use it with the free*/
pu8CurrByte = strWIDList[u32WidsCount].ps8WidVal;
kfree(strWID.ps8WidVal);
}
-#ifdef WILC_P2P
/**
* @brief Handle_RemainOnChan
* @details Sending config packet to edit station
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
}
-#endif
-
/**
* @brief Handle_EditStation
Handle_ScanDone(strHostIFmsg.drvHandler, SCAN_EVENT_DONE);
- #ifdef WILC_P2P
if (pstrWFIDrv->u8RemainOnChan_pendingreq)
Handle_RemainOnChan(strHostIFmsg.drvHandler, &strHostIFmsg.uniHostIFmsgBody.strHostIfRemainOnChan);
- #endif
break;
Handle_GetMacAddress(strHostIFmsg.drvHandler, &strHostIFmsg.uniHostIFmsgBody.strHostIfGetMacAddress);
break;
-#ifdef WILC_P2P
case HOST_IF_MSG_REMAIN_ON_CHAN:
PRINT_D(HOSTINF_DBG, "HOST_IF_MSG_REMAIN_ON_CHAN\n");
Handle_RemainOnChan(strHostIFmsg.drvHandler, &strHostIFmsg.uniHostIFmsgBody.strHostIfRemainOnChan);
Handle_ListenStateExpired(strHostIFmsg.drvHandler, &strHostIFmsg.uniHostIFmsgBody.strHostIfRemainOnChan);
break;
- #endif
case HOST_IF_MSG_SET_MULTICAST_FILTER:
PRINT_D(HOSTINF_DBG, "HOST_IF_MSG_SET_MULTICAST_FILTER\n");
Handle_SetMulticastFilter(strHostIFmsg.drvHandler, &strHostIFmsg.uniHostIFmsgBody.strHostIfSetMulti);
setup_timer(&pstrWFIDrv->hConnectTimer, TimerCB_Connect, 0);
- #ifdef WILC_P2P
/*Remain on channel timer*/
setup_timer(&pstrWFIDrv->hRemainOnChannel, ListenTimerCB, 0);
- #endif
sema_init(&(pstrWFIDrv->gtOsCfgValuesSem), 1);
down(&(pstrWFIDrv->gtOsCfgValuesSem));
pstrWFIDrv->strCfgValues.passive_scan_time = PASSIVE_SCAN_TIME;
pstrWFIDrv->strCfgValues.curr_tx_rate = AUTORATE;
-
- #ifdef WILC_P2P
-
pstrWFIDrv->u64P2p_MgmtTimeout = 0;
- #endif
-
PRINT_INFO(HOSTINF_DBG, "Initialization values, Site survey value: %d\n Scan source: %d\n Active scan time: %d\n Passive scan time: %d\nCurrent tx Rate = %d\n",
pstrWFIDrv->strCfgValues.site_survey_enabled, pstrWFIDrv->strCfgValues.scan_source,
_fail_mem_:
if (pstrWFIDrv != NULL)
kfree(pstrWFIDrv);
-#ifdef WILC_P2P
del_timer_sync(&pstrWFIDrv->hRemainOnChannel);
-#endif
_fail_timer_2:
up(&(pstrWFIDrv->gtOsCfgValuesSem));
del_timer_sync(&pstrWFIDrv->hConnectTimer);
/* msleep(HOST_IF_CONNECT_TIMEOUT+1000); */
}
- #ifdef WILC_P2P
/*Destroy Remain-onchannel Timer*/
del_timer_sync(&pstrWFIDrv->hRemainOnChannel);
- #endif
host_int_set_wfi_drv_handler(NULL);
down(&hSemDeinitDrvHandle);
}
-#ifdef WILC_P2P
/**
* @brief host_int_remain_on_channel
* @details
}
-#endif
/**
* @brief host_int_add_beacon
index += pu8IEs[index + 1] + 2;
continue;
}
- #ifdef WILC_P2P
else if ((pu8IEs[index] == P2P_IE) && /* P2P Element ID */
(pu8IEs[index + 2] == 0x50) && (pu8IEs[index + 3] == 0x6f) &&
(pu8IEs[index + 4] == 0x9a) && /* OUI */
continue;
}
- #endif
else if ((pu8IEs[index] == RSN_IE) ||
((pu8IEs[index] == WPA_IE) && (pu8IEs[index + 2] == 0x00) &&
(pu8IEs[index + 3] == 0x50) && (pu8IEs[index + 4] == 0xF2) &&
tstrDisconnectNotifInfo *,
void *);
-#ifdef WILC_P2P
typedef void (*tWILCpfRemainOnChanExpired)(void *, u32); /*Remain on channel expiration callback function*/
typedef void (*tWILCpfRemainOnChanReady)(void *); /*Remain on channel callback function*/
-#endif
/* typedef u32 WILC_WFIDrvHandle; */
typedef struct {
u16 u16SessionTimeout;
} tstrHostIfBASessionInfo;
-#ifdef WILC_P2P
typedef struct {
u16 u16Channel;
u32 u32duration;
P2P_GRP_FORMATION
};
-#endif
typedef struct {
/* Scan user structure */
tstrWILC_UsrScanReq strWILC_UsrScanReq;
/* Connect User structure */
tstrWILC_UsrConnReq strWILC_UsrConnReq;
- #ifdef WILC_P2P
/*Remain on channel struvture*/
tstrHostIfRemainOnChan strHostIfRemainOnChan;
u8 u8RemainOnChan_pendingreq;
u64 u64P2p_MgmtTimeout;
u8 u8P2PConnect;
- #endif
tenuHostIFstate enuHostIFstate;
/* timer handlers */
struct timer_list hScanTimer;
struct timer_list hConnectTimer;
- #ifdef WILC_P2P
struct timer_list hRemainOnChannel;
- #endif
bool IFC_UP;
} tstrWILC_WFIDrv;
*/
s32 host_int_get_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8IPAddr, u8 idx);
-#ifdef WILC_P2P
/**
* @brief host_int_remain_on_channel
* @details
* @version 1.0
*/
s32 host_int_frame_register(tstrWILC_WFIDrv *hWFIDrv, u16 u16FrameType, bool bReg);
-#endif
/**
* @brief host_int_set_wfi_drv_handler
* @details
}
}
- #ifdef WILC_P2P
nic = netdev_priv(g_linux_wlan->strInterfaceInfo[1].wilc_netdev); /* p2p0 */
if ((buff[0] == nic->g_struct_frame_reg[0].frame_type && nic->g_struct_frame_reg[0].reg) ||
(buff[0] == nic->g_struct_frame_reg[1].frame_type && nic->g_struct_frame_reg[1].reg))
WILC_WFI_p2p_rx(g_linux_wlan->strInterfaceInfo[1].wilc_netdev, buff, size);
- #endif
}
int wilc_netdev_init(void)
RATETAB_ENT(540, 12, 0),
};
-#ifdef WILC_P2P
struct p2p_mgmt_data {
int size;
u8 *buff;
u8 u8P2Precvrandom = 0x00;
u8 u8P2P_vendorspec[] = {0xdd, 0x05, 0x00, 0x08, 0x40, 0x03};
bool bWilc_ie;
-#endif
static struct ieee80211_supported_band WILC_WFI_band_2ghz = {
.channels = WILC_WFI_2ghz_channels,
{
struct wilc_priv *priv;
struct net_device *dev;
- #ifdef WILC_P2P
tstrWILC_WFIDrv *pstrWFIDrv;
- #endif
u8 NullBssid[ETH_ALEN] = {0};
connecting = 0;
priv = (struct wilc_priv *)pUserVoid;
dev = priv->dev;
- #ifdef WILC_P2P
pstrWFIDrv = (tstrWILC_WFIDrv *)priv->hWILCWFIDrv;
- #endif
if (enuConnDisconnEvent == CONN_DISCONN_EVENT_CONN_RESP) {
/*Initialization*/
/*BugID_5457*/
/*Invalidate u8WLANChannel value on wlan0 disconnect*/
- #ifdef WILC_P2P
if (!pstrWFIDrv->u8P2PConnect)
u8WLANChannel = INVALID_CHANNEL;
- #endif
PRINT_ER("Unspecified failure: Connection status %d : MAC status = %d\n", u16ConnectStatus, u8MacStatus);
}
/*BugID_5457*/
/*Invalidate u8WLANChannel value on wlan0 disconnect*/
- #ifdef WILC_P2P
if (!pstrWFIDrv->u8P2PConnect)
u8WLANChannel = INVALID_CHANNEL;
- #endif
/*BugID_5315*/
/*Incase "P2P CLIENT Connected" send deauthentication reason by 3 to force the WPA_SUPPLICANT to directly change
* virtual interface to station*/
host_int_set_wfi_drv_handler(priv->hWILCWFIDrv);
PRINT_D(CFG80211_DBG, "Connecting to SSID [%s] on netdev [%p] host if [%p]\n", sme->ssid, dev, priv->hWILCWFIDrv);
- #ifdef WILC_P2P
if (!(strncmp(sme->ssid, "DIRECT-", 7))) {
PRINT_D(CFG80211_DBG, "Connected to Direct network,OBSS disabled\n");
pstrWFIDrv->u8P2PConnect = 1;
} else
pstrWFIDrv->u8P2PConnect = 0;
- #endif
PRINT_INFO(CFG80211_DBG, "Required SSID = %s\n , AuthType = %d\n", sme->ssid, sme->auth_type);
for (i = 0; i < u32LastScannedNtwrksCountShadow; i++) {
{
s32 s32Error = 0;
struct wilc_priv *priv;
- #ifdef WILC_P2P
tstrWILC_WFIDrv *pstrWFIDrv;
- #endif
u8 NullBssid[ETH_ALEN] = {0};
connecting = 0;
/*BugID_5457*/
/*Invalidate u8WLANChannel value on wlan0 disconnect*/
- #ifdef WILC_P2P
pstrWFIDrv = (tstrWILC_WFIDrv *)priv->hWILCWFIDrv;
if (!pstrWFIDrv->u8P2PConnect)
u8WLANChannel = INVALID_CHANNEL;
- #endif
linux_wlan_set_bssid(priv->dev, NullBssid);
PRINT_D(CFG80211_DBG, "Disconnecting with reason code(%d)\n", reason_code);
u8P2Plocalrandom = 0x01;
u8P2Precvrandom = 0x00;
bWilc_ie = false;
- #ifdef WILC_P2P
pstrWFIDrv->u64P2p_MgmtTimeout = 0;
- #endif
s32Error = host_int_disconnect(priv->hWILCWFIDrv, reason_code);
if (s32Error != 0) {
return 0;
}
-#ifdef WILC_P2P
/**
* @brief WILC_WFI_CfgParseRxAction
}
-#endif /*WILC_P2P*/
/**
* @brief WILC_WFI_set_cqm_rssi_config
perInterface_wlan_t *nic;
u8 interface_type;
u16 TID = 0;
- #ifdef WILC_P2P
u8 i;
- #endif
nic = netdev_priv(dev);
priv = wiphy_priv(wiphy);
/*Remove the enteries of the previously connected clients*/
memset(priv->assoc_stainfo.au8Sta_AssociatedBss, 0, MAX_NUM_STA * ETH_ALEN);
- #ifdef WILC_P2P
interface_type = nic->iftype;
nic->iftype = STATION_MODE;
bEnablePS = true;
host_int_set_power_mgmt(priv->hWILCWFIDrv, 1, 0);
}
- #endif
break;
case NL80211_IFTYPE_P2P_CLIENT:
priv->wdev->iftype = type;
nic->monitor_flag = 0;
- #ifdef WILC_P2P
-
PRINT_D(HOSTAPD_DBG, "Downloading P2P_CONCURRENCY_FIRMWARE\n");
nic->iftype = CLIENT_MODE;
}
}
}
- #endif
break;
case NL80211_IFTYPE_AP:
PRINT_D(HOSTAPD_DBG, "Downloading AP firmware\n");
linux_wlan_get_firmware(nic);
- #ifdef WILC_P2P
/*If wilc is running, then close-open to actually get new firmware running (serves P2P)*/
if (g_linux_wlan->wilc1000_initialized) {
nic->iftype = AP_MODE;
nic->g_struct_frame_reg[i].reg);
}
}
- #endif
break;
case NL80211_IFTYPE_P2P_GO:
PRINT_D(CORECONFIG_DBG, "priv->hWILCWFIDrv[%p]\n", priv->hWILCWFIDrv);
- #ifdef WILC_P2P
PRINT_D(HOSTAPD_DBG, "Downloading P2P_CONCURRENCY_FIRMWARE\n");
nic->g_struct_frame_reg[i].reg);
}
}
- #endif
break;
default:
.set_pmksa = set_pmksa,
.del_pmksa = del_pmksa,
.flush_pmksa = flush_pmksa,
-#ifdef WILC_P2P
.remain_on_channel = remain_on_channel,
.cancel_remain_on_channel = cancel_remain_on_channel,
.mgmt_tx_cancel_wait = mgmt_tx_cancel_wait,
.mgmt_frame_register = WILC_WFI_frame_register,
.set_power_mgmt = WILC_WFI_set_power_mgmt,
.set_cqm_rssi_config = WILC_WFI_set_cqm_rssi_config,
-#endif
};
/*Setting default managment types: for register action frame: */
wdev->wiphy->mgmt_stypes = wilc_wfi_cfg80211_mgmt_types;
-#ifdef WILC_P2P
wdev->wiphy->max_remain_on_channel_duration = 500;
/*Setting the wiphy interfcae mode and type before registering the wiphy*/
wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_MONITOR) | BIT(NL80211_IFTYPE_P2P_GO) |
BIT(NL80211_IFTYPE_P2P_CLIENT);
wdev->wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
-#else
- wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_MONITOR);
-#endif
wdev->iftype = NL80211_IFTYPE_STATION;
#define AES BIT(5)
#define TKIP BIT(6)
-#ifdef WILC_P2P
-
/*Public action frame index IDs*/
#define FRAME_TYPE_ID 0
#define ACTION_CAT_ID 24
#define GAS_INTIAL_RSP 0x0b
#define INVALID_CHANNEL 0
-#endif
#define nl80211_SCAN_RESULT_EXPIRE (3 * HZ)
#define SCAN_RESULT_EXPIRE (40 * HZ)
u8 au8Sta_AssociatedBss[MAX_NUM_STA][ETH_ALEN];
};
-#ifdef WILC_P2P
/*Parameters needed for host interface for remaining on channel*/
struct wilc_wfi_p2pListenParams {
struct ieee80211_channel *pstrListenChan;
u32 u32ListenSessionID;
};
-#endif /*WILC_P2P*/
-
struct wilc_priv {
struct wireless_dev *wdev;
struct cfg80211_scan_request *pstrScanReq;
- #ifdef WILC_P2P
struct wilc_wfi_p2pListenParams strRemainOnChanParams;
u64 u64tx_cookie;
- #endif
bool bCfgScanning;
u32 u32RcvdChCount;
u8 iftype;
int monitor_flag;
int mac_opened;
- #ifdef WILC_P2P
struct_frame_reg g_struct_frame_reg[num_reg_frame];
- #endif
struct net_device *wilc_netdev;
struct net_device_stats netstats;
/*return number of itemes in the queue*/
return p->txq_entries;
}
+
/*Bug3959: transmitting mgmt frames received from host*/
-#if defined(WILC_P2P)
int wilc_wlan_txq_add_mgmt_pkt(void *priv, u8 *buffer, u32 buffer_size, wilc_tx_complete_func_t func)
{
wilc_wlan_txq_add_to_tail(tqe);
return 1;
}
-#endif /* WILC_P2P */
+
static struct txq_entry_t *wilc_wlan_txq_get_first(void)
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
}
/*bug 3887: [AP] Allow Management frames to be passed to the host*/
- #if defined(WILC_P2P)
#define IS_MANAGMEMENT 0x100
#define IS_MANAGMEMENT_CALLBACK 0x080
#define IS_MGMT_STATUS_SUCCES 0x040
}
/* BUG4530 fix */
else
- #endif
{
if (!is_cfg_packet) {
oup->wlan_cfg_get_value = wilc_wlan_cfg_get_val;
/*Bug3959: transmitting mgmt frames received from host*/
- #if defined(WILC_P2P)
oup->wlan_add_mgmt_to_tx_que = wilc_wlan_txq_add_mgmt_pkt;
- #endif
if (!init_chip()) {
/* EIO 5 */
#define WILC_WLAN_IF_H
/*bug 3887: [AP] Allow Management frames to be passed to the host*/
-#define WILC_P2P
#define TCP_ENHANCEMENTS
/* #define MEMORY_STATIC */
/* #define USE_OLD_SPI_SW */
int (*wlan_cfg_get)(int, u32, int, u32);
int (*wlan_cfg_get_value)(u32, u8 *, u32);
/*Bug3959: transmitting mgmt frames received from host*/
- #if defined(WILC_P2P)
int (*wlan_add_mgmt_to_tx_que)(void *, u8 *, u32, wilc_tx_complete_func_t);
- #endif
} wilc_wlan_oup_t;
/********************************************
RSN_IE = 48,
WPA_IE = 221,
WMM_IE = 221,
- #ifdef WILC_P2P
P2P_IE = 221,
- #endif
} BEACON_IE;
#endif
typedef enum {
WID_HUT_TEST_ID = 0x3081,
WID_PMKID_INFO = 0x3082,
WID_FIRMWARE_INFO = 0x3083,
- #ifdef WILC_P2P
WID_REGISTER_FRAME = 0x3084,
- #endif
WID_DEL_ALL_STA = 0x3085,
- #ifdef WILC_P2P
WID_REMAIN_ON_CHAN = 0x3996,
- #endif
/*BugID_4156*/
WID_SSID_PROBE_REQ = 0x3997,
/*BugID_4124 WID to trigger modified Join Request using SSID and BSSID instead of bssListIdx (used by WID_JOIN_REQ)*/