Commit 771fbae4 authored by Leo Kim's avatar Leo Kim Committed by Greg Kroah-Hartman

staging: wilc1000: rename u32LastScannedNtwrksCountShadow variable

This patch renames u32LastScannedNtwrksCountShadow variable to last_scanned_cnt
to avoid camelcase.
Signed-off-by: default avatarLeo Kim <leo.kim@atmel.com>
Signed-off-by: default avatarGlen Lee <glen.lee@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 825b966f
...@@ -107,7 +107,7 @@ extern int wilc_mac_open(struct net_device *ndev); ...@@ -107,7 +107,7 @@ extern int wilc_mac_open(struct net_device *ndev);
extern int wilc_mac_close(struct net_device *ndev); extern int wilc_mac_close(struct net_device *ndev);
static tstrNetworkInfo astrLastScannedNtwrksShadow[MAX_NUM_SCANNED_NETWORKS_SHADOW]; static tstrNetworkInfo astrLastScannedNtwrksShadow[MAX_NUM_SCANNED_NETWORKS_SHADOW];
static u32 u32LastScannedNtwrksCountShadow; static u32 last_scanned_cnt;
struct timer_list wilc_during_ip_timer; struct timer_list wilc_during_ip_timer;
static struct timer_list hAgingTimer; static struct timer_list hAgingTimer;
static u8 op_ifcs; static u8 op_ifcs;
...@@ -213,16 +213,16 @@ static void clear_shadow_scan(void *pUserVoid) ...@@ -213,16 +213,16 @@ static void clear_shadow_scan(void *pUserVoid)
del_timer_sync(&hAgingTimer); del_timer_sync(&hAgingTimer);
PRINT_INFO(CORECONFIG_DBG, "destroy aging timer\n"); PRINT_INFO(CORECONFIG_DBG, "destroy aging timer\n");
for (i = 0; i < u32LastScannedNtwrksCountShadow; i++) { for (i = 0; i < last_scanned_cnt; i++) {
if (astrLastScannedNtwrksShadow[u32LastScannedNtwrksCountShadow].pu8IEs != NULL) { if (astrLastScannedNtwrksShadow[last_scanned_cnt].pu8IEs != NULL) {
kfree(astrLastScannedNtwrksShadow[i].pu8IEs); kfree(astrLastScannedNtwrksShadow[i].pu8IEs);
astrLastScannedNtwrksShadow[u32LastScannedNtwrksCountShadow].pu8IEs = NULL; astrLastScannedNtwrksShadow[last_scanned_cnt].pu8IEs = NULL;
} }
wilc_free_join_params(astrLastScannedNtwrksShadow[i].pJoinParams); wilc_free_join_params(astrLastScannedNtwrksShadow[i].pJoinParams);
astrLastScannedNtwrksShadow[i].pJoinParams = NULL; astrLastScannedNtwrksShadow[i].pJoinParams = NULL;
} }
u32LastScannedNtwrksCountShadow = 0; last_scanned_cnt = 0;
} }
} }
...@@ -251,7 +251,7 @@ static void refresh_scan(void *pUserVoid, u8 all, bool bDirectScan) ...@@ -251,7 +251,7 @@ static void refresh_scan(void *pUserVoid, u8 all, bool bDirectScan)
priv = (struct wilc_priv *)pUserVoid; priv = (struct wilc_priv *)pUserVoid;
wiphy = priv->dev->ieee80211_ptr->wiphy; wiphy = priv->dev->ieee80211_ptr->wiphy;
for (i = 0; i < u32LastScannedNtwrksCountShadow; i++) { for (i = 0; i < last_scanned_cnt; i++) {
tstrNetworkInfo *pstrNetworkInfo; tstrNetworkInfo *pstrNetworkInfo;
pstrNetworkInfo = &(astrLastScannedNtwrksShadow[i]); pstrNetworkInfo = &(astrLastScannedNtwrksShadow[i]);
...@@ -284,19 +284,16 @@ static void reset_shadow_found(void *pUserVoid) ...@@ -284,19 +284,16 @@ static void reset_shadow_found(void *pUserVoid)
{ {
int i; int i;
for (i = 0; i < u32LastScannedNtwrksCountShadow; i++) { for (i = 0; i < last_scanned_cnt; i++)
astrLastScannedNtwrksShadow[i].u8Found = 0; astrLastScannedNtwrksShadow[i].u8Found = 0;
}
} }
static void update_scan_time(void *pUserVoid) static void update_scan_time(void *pUserVoid)
{ {
int i; int i;
for (i = 0; i < u32LastScannedNtwrksCountShadow; i++) { for (i = 0; i < last_scanned_cnt; i++)
astrLastScannedNtwrksShadow[i].u32TimeRcvdInScan = jiffies; astrLastScannedNtwrksShadow[i].u32TimeRcvdInScan = jiffies;
}
} }
static void remove_network_from_shadow(unsigned long arg) static void remove_network_from_shadow(unsigned long arg)
...@@ -305,7 +302,7 @@ static void remove_network_from_shadow(unsigned long arg) ...@@ -305,7 +302,7 @@ static void remove_network_from_shadow(unsigned long arg)
int i, j; int i, j;
for (i = 0; i < u32LastScannedNtwrksCountShadow; i++) { for (i = 0; i < last_scanned_cnt; i++) {
if (time_after(now, astrLastScannedNtwrksShadow[i].u32TimeRcvdInScan + (unsigned long)(SCAN_RESULT_EXPIRE))) { if (time_after(now, astrLastScannedNtwrksShadow[i].u32TimeRcvdInScan + (unsigned long)(SCAN_RESULT_EXPIRE))) {
PRINT_D(CFG80211_DBG, "Network expired in ScanShadow: %s\n", astrLastScannedNtwrksShadow[i].au8ssid); PRINT_D(CFG80211_DBG, "Network expired in ScanShadow: %s\n", astrLastScannedNtwrksShadow[i].au8ssid);
...@@ -314,15 +311,16 @@ static void remove_network_from_shadow(unsigned long arg) ...@@ -314,15 +311,16 @@ static void remove_network_from_shadow(unsigned long arg)
wilc_free_join_params(astrLastScannedNtwrksShadow[i].pJoinParams); wilc_free_join_params(astrLastScannedNtwrksShadow[i].pJoinParams);
for (j = i; (j < u32LastScannedNtwrksCountShadow - 1); j++) { for (j = i; (j < last_scanned_cnt - 1); j++)
astrLastScannedNtwrksShadow[j] = astrLastScannedNtwrksShadow[j + 1]; astrLastScannedNtwrksShadow[j] = astrLastScannedNtwrksShadow[j + 1];
}
u32LastScannedNtwrksCountShadow--; last_scanned_cnt--;
} }
} }
PRINT_D(CFG80211_DBG, "Number of cached networks: %d\n", u32LastScannedNtwrksCountShadow); PRINT_D(CFG80211_DBG, "Number of cached networks: %d\n",
if (u32LastScannedNtwrksCountShadow != 0) { last_scanned_cnt);
if (last_scanned_cnt != 0) {
hAgingTimer.data = arg; hAgingTimer.data = arg;
mod_timer(&hAgingTimer, jiffies + msecs_to_jiffies(AGING_TIME)); mod_timer(&hAgingTimer, jiffies + msecs_to_jiffies(AGING_TIME));
} else { } else {
...@@ -341,14 +339,14 @@ static int is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoi ...@@ -341,14 +339,14 @@ static int is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoi
int state = -1; int state = -1;
int i; int i;
if (u32LastScannedNtwrksCountShadow == 0) { if (last_scanned_cnt == 0) {
PRINT_D(CFG80211_DBG, "Starting Aging timer\n"); PRINT_D(CFG80211_DBG, "Starting Aging timer\n");
hAgingTimer.data = (unsigned long)pUserVoid; hAgingTimer.data = (unsigned long)pUserVoid;
mod_timer(&hAgingTimer, jiffies + msecs_to_jiffies(AGING_TIME)); mod_timer(&hAgingTimer, jiffies + msecs_to_jiffies(AGING_TIME));
state = -1; state = -1;
} else { } else {
/* Linear search for now */ /* Linear search for now */
for (i = 0; i < u32LastScannedNtwrksCountShadow; i++) { for (i = 0; i < last_scanned_cnt; i++) {
if (memcmp(astrLastScannedNtwrksShadow[i].au8bssid, if (memcmp(astrLastScannedNtwrksShadow[i].au8bssid,
pstrNetworkInfo->au8bssid, 6) == 0) { pstrNetworkInfo->au8bssid, 6) == 0) {
state = i; state = i;
...@@ -365,13 +363,13 @@ static void add_network_to_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserV ...@@ -365,13 +363,13 @@ static void add_network_to_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserV
u32 ap_index = 0; u32 ap_index = 0;
u8 rssi_index = 0; u8 rssi_index = 0;
if (u32LastScannedNtwrksCountShadow >= MAX_NUM_SCANNED_NETWORKS_SHADOW) { if (last_scanned_cnt >= MAX_NUM_SCANNED_NETWORKS_SHADOW) {
PRINT_D(CFG80211_DBG, "Shadow network reached its maximum limit\n"); PRINT_D(CFG80211_DBG, "Shadow network reached its maximum limit\n");
return; return;
} }
if (ap_found == -1) { if (ap_found == -1) {
ap_index = u32LastScannedNtwrksCountShadow; ap_index = last_scanned_cnt;
u32LastScannedNtwrksCountShadow++; last_scanned_cnt++;
} else { } else {
ap_index = ap_found; ap_index = ap_found;
...@@ -619,7 +617,7 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent, ...@@ -619,7 +617,7 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent,
memcpy(priv->au8AssociatedBss, pstrConnectInfo->au8bssid, ETH_ALEN); memcpy(priv->au8AssociatedBss, pstrConnectInfo->au8bssid, ETH_ALEN);
for (i = 0; i < u32LastScannedNtwrksCountShadow; i++) { for (i = 0; i < last_scanned_cnt; i++) {
if (memcmp(astrLastScannedNtwrksShadow[i].au8bssid, if (memcmp(astrLastScannedNtwrksShadow[i].au8bssid,
pstrConnectInfo->au8bssid, ETH_ALEN) == 0) { pstrConnectInfo->au8bssid, ETH_ALEN) == 0) {
unsigned long now = jiffies; unsigned long now = jiffies;
...@@ -850,7 +848,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -850,7 +848,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
} }
PRINT_INFO(CFG80211_DBG, "Required SSID = %s\n , AuthType = %d\n", sme->ssid, sme->auth_type); PRINT_INFO(CFG80211_DBG, "Required SSID = %s\n , AuthType = %d\n", sme->ssid, sme->auth_type);
for (i = 0; i < u32LastScannedNtwrksCountShadow; i++) { for (i = 0; i < last_scanned_cnt; i++) {
if ((sme->ssid_len == astrLastScannedNtwrksShadow[i].u8SsidLen) && if ((sme->ssid_len == astrLastScannedNtwrksShadow[i].u8SsidLen) &&
memcmp(astrLastScannedNtwrksShadow[i].au8ssid, memcmp(astrLastScannedNtwrksShadow[i].au8ssid,
sme->ssid, sme->ssid,
...@@ -874,7 +872,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -874,7 +872,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
} }
} }
if (i < u32LastScannedNtwrksCountShadow) { if (i < last_scanned_cnt) {
PRINT_D(CFG80211_DBG, "Required bss is in scan results\n"); PRINT_D(CFG80211_DBG, "Required bss is in scan results\n");
pstrNetworkInfo = &(astrLastScannedNtwrksShadow[i]); pstrNetworkInfo = &(astrLastScannedNtwrksShadow[i]);
...@@ -885,7 +883,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -885,7 +883,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
pstrNetworkInfo->au8bssid[4], pstrNetworkInfo->au8bssid[5]); pstrNetworkInfo->au8bssid[4], pstrNetworkInfo->au8bssid[5]);
} else { } else {
s32Error = -ENOENT; s32Error = -ENOENT;
if (u32LastScannedNtwrksCountShadow == 0) if (last_scanned_cnt == 0)
PRINT_D(CFG80211_DBG, "No Scan results yet\n"); PRINT_D(CFG80211_DBG, "No Scan results yet\n");
else else
PRINT_D(CFG80211_DBG, "Required bss not in scan results: Error(%d)\n", s32Error); PRINT_D(CFG80211_DBG, "Required bss not in scan results: Error(%d)\n", s32Error);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment