#include "wilc_wfi_cfgoperations.h"
#include "wilc_wlan.c"
#ifdef WILC_SDIO
-#include "linux_wlan_sdio.h" /* tony : for set_wiphy_dev() */
+#include "linux_wlan_sdio.h"
#endif
#include <linux/errno.h>
tstrNetworkInfo astrLastScannedNtwrksShadow[MAX_NUM_SCANNED_NETWORKS_SHADOW];
u32 u32LastScannedNtwrksCountShadow;
-#ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
struct timer_list hDuringIpTimer;
-#endif
struct timer_list hAgingTimer;
static u8 op_ifcs;
extern u8 u8ConnectedSSID[6];
u8 g_wilc_initialized = 1;
extern linux_wlan_t *g_linux_wlan;
-#ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
extern bool g_obtainingIP;
-#endif
#define CHAN2G(_channel, _freq, _flags) { \
.band = IEEE80211_BAND_2GHZ, \
/*Global variable used to state the current connected STA channel*/
u8 u8WLANChannel = INVALID_CHANNEL;
-u8 u8CurrChannel;
+u8 curr_channel;
u8 u8P2P_oui[] = {0x50, 0x6f, 0x9A, 0x09};
u8 u8P2Plocalrandom = 0x01;
}
}
-#ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
static void clear_duringIP(unsigned long arg)
{
PRINT_D(GENERIC_DBG, "GO:IP Obtained , enable scan\n");
g_obtainingIP = false;
}
-#endif
-int8_t is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
+int is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
{
- int8_t state = -1;
+ int state = -1;
int i;
if (u32LastScannedNtwrksCountShadow == 0) {
void add_network_to_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid, void *pJoinParams)
{
- int8_t ap_found = is_network_in_shadow(pstrNetworkInfo, pUserVoid);
+ int ap_found = is_network_in_shadow(pstrNetworkInfo, pUserVoid);
u32 ap_index = 0;
u8 rssi_index = 0;
u16ConnectStatus, GFP_KERNEL); /* TODO: mostafa: u16ConnectStatus to */
/* be replaced by pstrConnectInfo->u16ConnectStatus */
} else if (enuConnDisconnEvent == CONN_DISCONN_EVENT_DISCONN_NOTIF) {
- #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
g_obtainingIP = false;
- #endif
PRINT_ER("Received MAC_DISCONNECTED from firmware with reason %d on dev [%p]\n",
pstrDisconnectNotifInfo->u16reason, priv->dev);
u8P2Plocalrandom = 0x01;
static int set_channel(struct wiphy *wiphy,
struct cfg80211_chan_def *chandef)
{
-
u32 channelnum = 0;
struct wilc_priv *priv;
- s32 s32Error = 0;
+ int result = 0;
priv = wiphy_priv(wiphy);
channelnum = ieee80211_frequency_to_channel(chandef->chan->center_freq);
PRINT_D(CFG80211_DBG, "Setting channel %d with frequency %d\n", channelnum, chandef->chan->center_freq);
- u8CurrChannel = channelnum;
- s32Error = host_int_set_mac_chnl_num(priv->hWILCWFIDrv, channelnum);
+ curr_channel = channelnum;
+ result = host_int_set_mac_chnl_num(priv->hWILCWFIDrv, channelnum);
- if (s32Error != 0)
+ if (result != 0)
PRINT_ER("Error in setting channel %d\n", channelnum);
- return s32Error;
+ return result;
}
/**
* @version 1.0
*/
-/*
- * kernel version 3.8.8 supported
- * tony, sswd, WILC-KR, 2013-10-29
- */
static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
{
struct wilc_priv *priv;
u32 i;
s32 s32Error = 0;
u8 au8ScanChanList[MAX_NUM_SCANNED_NETWORKS];
- tstrHiddenNetwork strHiddenNetwork;
+ struct hidden_network strHiddenNetwork;
priv = wiphy_priv(wiphy);
if (request->n_ssids >= 1) {
- strHiddenNetwork.pstrHiddenNetworkInfo = kmalloc(request->n_ssids * sizeof(tstrHiddenNetwork), GFP_KERNEL);
+ strHiddenNetwork.pstrHiddenNetworkInfo = kmalloc(request->n_ssids * sizeof(struct hidden_network), GFP_KERNEL);
strHiddenNetwork.u8ssidnum = request->n_ssids;
s32 s32Error = 0;
u32 i;
u8 u8security = NO_ENCRYPT;
- AUTHTYPE_T tenuAuth_type = ANY;
+ enum AUTHTYPE tenuAuth_type = ANY;
char *pcgroup_encrypt_val = NULL;
char *pccipher_group = NULL;
char *pcwpa_version = NULL;
PRINT_INFO(CFG80211_DBG, "Group encryption value = %s\n Cipher Group = %s\n WPA version = %s\n",
pcgroup_encrypt_val, pccipher_group, pcwpa_version);
- u8CurrChannel = pstrNetworkInfo->u8channel;
+ curr_channel = pstrNetworkInfo->u8channel;
if (!pstrWFIDrv->u8P2PConnect) {
u8WLANChannel = pstrNetworkInfo->u8channel;
u8 u8mode = NO_ENCRYPT;
u8 u8gmode = NO_ENCRYPT;
u8 u8pmode = NO_ENCRYPT;
- AUTHTYPE_T tenuAuth_type = ANY;
+ enum AUTHTYPE tenuAuth_type = ANY;
priv = wiphy_priv(wiphy);
host_int_get_statistics(priv->hWILCWFIDrv, &strStatistics);
- /*
- * tony: 2013-11-13
- * tx_failed introduced more than
- * kernel version 3.0.0
- */
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL) |
BIT(NL80211_STA_INFO_RX_PACKETS) |
BIT(NL80211_STA_INFO_TX_PACKETS) |
PRINT_D(GENERIC_DBG, "Rx Frame Type:%x\n", buff[FRAME_TYPE_ID]);
/*Upper layer is informed that the frame is received on this freq*/
- s32Freq = ieee80211_channel_to_frequency(u8CurrChannel, IEEE80211_BAND_2GHZ);
+ s32Freq = ieee80211_channel_to_frequency(curr_channel, IEEE80211_BAND_2GHZ);
if (ieee80211_is_action(buff[FRAME_TYPE_ID])) {
PRINT_D(GENERIC_DBG, "Rx Action Frame Type: %x %x\n", buff[ACTION_SUBTYPE_ID], buff[P2P_PUB_ACTION_SUBTYPE]);
return s32Error;
}
- u8CurrChannel = chan->hw_value;
+ curr_channel = chan->hw_value;
/*Setting params needed by WILC_WFI_RemainOnChannelExpired()*/
priv->strRemainOnChanParams.pstrListenChan = chan;
*/
extern linux_wlan_t *g_linux_wlan;
extern bool bEnablePS;
-int mgmt_tx(struct wiphy *wiphy,
- struct wireless_dev *wdev,
- struct cfg80211_mgmt_tx_params *params,
- u64 *cookie)
+static int mgmt_tx(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ struct cfg80211_mgmt_tx_params *params,
+ u64 *cookie)
{
struct ieee80211_channel *chan = params->chan;
unsigned int wait = params->wait;
PRINT_D(GENERIC_DBG, "Setting channel: %d\n", chan->hw_value);
host_int_set_mac_chnl_num(priv->hWILCWFIDrv, chan->hw_value);
/*Save the current channel after we tune to it*/
- u8CurrChannel = chan->hw_value;
+ curr_channel = chan->hw_value;
} else if (ieee80211_is_action(mgmt->frame_control)) {
PRINT_D(GENERIC_DBG, "ACTION FRAME:%x\n", (u16)mgmt->frame_control);
PRINT_D(GENERIC_DBG, "Setting channel: %d\n", chan->hw_value);
host_int_set_mac_chnl_num(priv->hWILCWFIDrv, chan->hw_value);
/*Save the current channel after we tune to it*/
- u8CurrChannel = chan->hw_value;
+ curr_channel = chan->hw_value;
}
switch (buf[ACTION_SUBTYPE_ID]) {
case GAS_INTIAL_REQ:
}
- g_linux_wlan->oup.wlan_add_mgmt_to_tx_que(mgmt_tx, mgmt_tx->buff, mgmt_tx->size, WILC_WFI_mgmt_tx_complete);
+ wilc_wlan_txq_add_mgmt_pkt(mgmt_tx, mgmt_tx->buff,
+ mgmt_tx->size,
+ WILC_WFI_mgmt_tx_complete);
} else {
PRINT_D(GENERIC_DBG, "This function transmits only management frames\n");
}
return s32Error;
}
-int mgmt_tx_cancel_wait(struct wiphy *wiphy,
- struct wireless_dev *wdev,
- u64 cookie)
+static int mgmt_tx_cancel_wait(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ u64 cookie)
{
struct wilc_priv *priv;
tstrWILC_WFIDrv *pstrWFIDrv;
}
/**
- * @brief WILC_WFI_set_cqm_rssi_config
+ * @brief set_cqm_rssi_config
* @details Configure connection quality monitor RSSI threshold.
* @param[in] struct wiphy *wiphy:
* @param[in] struct net_device *dev:
* @date 01 MAR 2012
* @version 1.0
*/
-static int WILC_WFI_set_cqm_rssi_config(struct wiphy *wiphy,
- struct net_device *dev, s32 rssi_thold, u32 rssi_hyst)
+static int set_cqm_rssi_config(struct wiphy *wiphy, struct net_device *dev,
+ s32 rssi_thold, u32 rssi_hyst)
{
PRINT_D(CFG80211_DBG, "Setting CQM RSSi Function\n");
return 0;
* @return int : Return 0 on Success.
* @author mdaftedar
* @date 01 JUL 2012
- * @version 1.0WILC_WFI_set_cqmWILC_WFI_set_cqm_rssi_configWILC_WFI_set_cqm_rssi_configWILC_WFI_set_cqm_rssi_configWILC_WFI_set_cqm_rssi_config_rssi_config
+ * @version 1.0
*/
static int set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
bool enabled, int timeout)
bWilc_ie = false;
- #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
g_obtainingIP = false;
del_timer(&hDuringIpTimer);
PRINT_D(GENERIC_DBG, "Changing virtual interface, enable scan\n");
- #endif
/*Set WILC_CHANGING_VIR_IF register to disallow adding futrue keys to CE H/W*/
if (g_ptk_keys_saved && g_gtk_keys_saved) {
Set_machw_change_vir_if(true);
case NL80211_IFTYPE_P2P_GO:
PRINT_D(GENERIC_DBG, "start duringIP timer\n");
- #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
g_obtainingIP = true;
mod_timer(&hDuringIpTimer, jiffies + msecs_to_jiffies(duringIP_TIME));
- #endif
host_int_set_power_mgmt(priv->hWILCWFIDrv, 0, 0);
/*Delete block ack has to be the latest config packet*/
/*sent before downloading new FW. This is because it blocks on*/
* @date 01 JUL 2012
* @version 1.0
*/
-struct wireless_dev *add_virtual_intf(struct wiphy *wiphy, const char *name,
- unsigned char name_assign_type,
- enum nl80211_iftype type, u32 *flags,
- struct vif_params *params)
+static struct wireless_dev *add_virtual_intf(struct wiphy *wiphy,
+ const char *name,
+ unsigned char name_assign_type,
+ enum nl80211_iftype type,
+ u32 *flags,
+ struct vif_params *params)
{
perInterface_wlan_t *nic;
struct wilc_priv *priv;
* @date 01 JUL 2012
* @version 1.0
*/
-int del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev) /* tony for v3.8 support */
+static int del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
{
PRINT_D(HOSTAPD_DBG, "Deleting virtual interface\n");
return 0;
.mgmt_tx = mgmt_tx,
.mgmt_frame_register = wilc_mgmt_frame_register,
.set_power_mgmt = set_power_mgmt,
- .set_cqm_rssi_config = WILC_WFI_set_cqm_rssi_config,
+ .set_cqm_rssi_config = set_cqm_rssi_config,
};
* @return int : Return 0 on Success.
* @author mdaftedar
* @date 01 MAR 2012
- * @version 1.0WILC_WFI_set_cqmWILC_WFI_set_cqm_rssi_configWILC_WFI_set_cqm_rssi_configWILC_WFI_set_cqm_rssi_configWILC_WFI_set_cqm_rssi_config_rssi_config
+ * @version 1.0
*/
int WILC_WFI_update_stats(struct wiphy *wiphy, u32 pktlen, u8 changed)
{
struct wilc_priv *priv;
priv = wiphy_priv(wiphy);
-#if 1
switch (changed) {
case WILC_WFI_RX_PKT:
default:
break;
}
-#endif
return 0;
}
wdev->wiphy->interface_modes, wdev->iftype);
#ifdef WILC_SDIO
- set_wiphy_dev(wdev->wiphy, &local_sdio_func->dev); /* tony */
+ set_wiphy_dev(wdev->wiphy, &local_sdio_func->dev);
#endif
/*Register wiphy structure*/
priv = wdev_priv(net->ieee80211_ptr);
if (op_ifcs == 0) {
setup_timer(&hAgingTimer, remove_network_from_shadow, 0);
- #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
setup_timer(&hDuringIpTimer, clear_duringIP, 0);
- #endif
}
op_ifcs++;
if (s32Error < 0) {
/* Clear the Shadow scan */
clear_shadow_scan(priv);
- #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
if (op_ifcs == 0) {
PRINT_D(CORECONFIG_DBG, "destroy during ip\n");
del_timer_sync(&hDuringIpTimer);
}
- #endif
if (s32Error)
PRINT_ER("Error while deintializing host interface\n");