Commit 986fc8e7 authored by Joshua Clayton's avatar Joshua Clayton Committed by Greg Kroah-Hartman

staging: rtl8712: rename function

Rename r8712_get_ndis_wlan_bssid_ex_sz() to r8712_get_wlan_bssid_ex_sz(),
which corresponds to the struct whose size it measures.
Signed-off-by: default avatarJoshua Clayton <stillcompiling@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 44367877
...@@ -456,7 +456,7 @@ u8 r8712_createbss_cmd(struct _adapter *padapter) ...@@ -456,7 +456,7 @@ u8 r8712_createbss_cmd(struct _adapter *padapter)
INIT_LIST_HEAD(&pcmd->list); INIT_LIST_HEAD(&pcmd->list);
pcmd->cmdcode = _CreateBss_CMD_; pcmd->cmdcode = _CreateBss_CMD_;
pcmd->parmbuf = (unsigned char *)pdev_network; pcmd->parmbuf = (unsigned char *)pdev_network;
pcmd->cmdsz = r8712_get_ndis_wlan_bssid_ex_sz(pdev_network); pcmd->cmdsz = r8712_get_wlan_bssid_ex_sz(pdev_network);
pcmd->rsp = NULL; pcmd->rsp = NULL;
pcmd->rspsz = 0; pcmd->rspsz = 0;
/* notes: translate IELength & Length after assign to cmdsz; */ /* notes: translate IELength & Length after assign to cmdsz; */
...@@ -564,7 +564,7 @@ u8 r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork) ...@@ -564,7 +564,7 @@ u8 r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork)
memcpy(&psecuritypriv->supplicant_ie[1], &psecnetwork->IEs[0], memcpy(&psecuritypriv->supplicant_ie[1], &psecnetwork->IEs[0],
255); 255);
/* get cmdsz before endian conversion */ /* get cmdsz before endian conversion */
pcmd->cmdsz = r8712_get_ndis_wlan_bssid_ex_sz(psecnetwork); pcmd->cmdsz = r8712_get_wlan_bssid_ex_sz(psecnetwork);
#ifdef __BIG_ENDIAN #ifdef __BIG_ENDIAN
/* wlan_network endian conversion */ /* wlan_network endian conversion */
psecnetwork->Length = cpu_to_le32(psecnetwork->Length); psecnetwork->Length = cpu_to_le32(psecnetwork->Length);
...@@ -946,11 +946,11 @@ void r8712_createbss_cmd_callback(struct _adapter *padapter, ...@@ -946,11 +946,11 @@ void r8712_createbss_cmd_callback(struct _adapter *padapter,
} else } else
list_add_tail(&(pwlan->list), list_add_tail(&(pwlan->list),
&pmlmepriv->scanned_queue.queue); &pmlmepriv->scanned_queue.queue);
pnetwork->Length = r8712_get_ndis_wlan_bssid_ex_sz(pnetwork); pnetwork->Length = r8712_get_wlan_bssid_ex_sz(pnetwork);
memcpy(&(pwlan->network), pnetwork, pnetwork->Length); memcpy(&(pwlan->network), pnetwork, pnetwork->Length);
pwlan->fixed = true; pwlan->fixed = true;
memcpy(&tgt_network->network, pnetwork, memcpy(&tgt_network->network, pnetwork,
(r8712_get_ndis_wlan_bssid_ex_sz(pnetwork))); (r8712_get_wlan_bssid_ex_sz(pnetwork)));
if (pmlmepriv->fw_state & _FW_UNDER_LINKING) if (pmlmepriv->fw_state & _FW_UNDER_LINKING)
pmlmepriv->fw_state ^= _FW_UNDER_LINKING; pmlmepriv->fw_state ^= _FW_UNDER_LINKING;
/* we will set _FW_LINKED when there is one more sat to /* we will set _FW_LINKED when there is one more sat to
......
...@@ -208,7 +208,7 @@ void r8712_generate_random_ibss(u8 *pibss) ...@@ -208,7 +208,7 @@ void r8712_generate_random_ibss(u8 *pibss)
pibss[5] = (u8)((curtime>>16) & 0xff); pibss[5] = (u8)((curtime>>16) & 0xff);
} }
uint r8712_get_ndis_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss) uint r8712_get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss)
{ {
return sizeof(*bss) + bss->IELength - MAX_IE_SZ; return sizeof(*bss) + bss->IELength - MAX_IE_SZ;
} }
...@@ -356,7 +356,7 @@ static void update_network(struct wlan_bssid_ex *dst, ...@@ -356,7 +356,7 @@ static void update_network(struct wlan_bssid_ex *dst,
src->Rssi = padapter->recvpriv.signal; src->Rssi = padapter->recvpriv.signal;
} else } else
src->Rssi = (src->Rssi + dst->Rssi) / 2; src->Rssi = (src->Rssi + dst->Rssi) / 2;
memcpy((u8 *)dst, (u8 *)src, r8712_get_ndis_wlan_bssid_ex_sz(src)); memcpy((u8 *)dst, (u8 *)src, r8712_get_wlan_bssid_ex_sz(src));
} }
static void update_current_network(struct _adapter *adapter, static void update_current_network(struct _adapter *adapter,
...@@ -416,7 +416,7 @@ static void update_scanned_network(struct _adapter *adapter, ...@@ -416,7 +416,7 @@ static void update_scanned_network(struct _adapter *adapter,
target->Rssi = (pnetwork->network.Rssi + target->Rssi = (pnetwork->network.Rssi +
target->Rssi) / 2; target->Rssi) / 2;
memcpy(&pnetwork->network, target, memcpy(&pnetwork->network, target,
r8712_get_ndis_wlan_bssid_ex_sz(target)); r8712_get_wlan_bssid_ex_sz(target));
pnetwork->last_scanned = jiffies; pnetwork->last_scanned = jiffies;
} else { } else {
/* Otherwise just pull from the free list */ /* Otherwise just pull from the free list */
...@@ -424,7 +424,7 @@ static void update_scanned_network(struct _adapter *adapter, ...@@ -424,7 +424,7 @@ static void update_scanned_network(struct _adapter *adapter,
pnetwork = alloc_network(pmlmepriv); pnetwork = alloc_network(pmlmepriv);
if (pnetwork == NULL) if (pnetwork == NULL)
return; return;
bssid_ex_sz = r8712_get_ndis_wlan_bssid_ex_sz(target); bssid_ex_sz = r8712_get_wlan_bssid_ex_sz(target);
target->Length = bssid_ex_sz; target->Length = bssid_ex_sz;
memcpy(&pnetwork->network, target, bssid_ex_sz); memcpy(&pnetwork->network, target, bssid_ex_sz);
list_add_tail(&pnetwork->list, &queue->queue); list_add_tail(&pnetwork->list, &queue->queue);
...@@ -528,7 +528,7 @@ void r8712_survey_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -528,7 +528,7 @@ void r8712_survey_event_callback(struct _adapter *adapter, u8 *pbuf)
le32_to_cpu(pnetwork->InfrastructureMode); le32_to_cpu(pnetwork->InfrastructureMode);
pnetwork->IELength = le32_to_cpu(pnetwork->IELength); pnetwork->IELength = le32_to_cpu(pnetwork->IELength);
#endif #endif
len = r8712_get_ndis_wlan_bssid_ex_sz(pnetwork); len = r8712_get_wlan_bssid_ex_sz(pnetwork);
if (len > sizeof(struct wlan_bssid_ex)) if (len > sizeof(struct wlan_bssid_ex))
return; return;
spin_lock_irqsave(&pmlmepriv->lock2, flags); spin_lock_irqsave(&pmlmepriv->lock2, flags);
...@@ -759,7 +759,7 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -759,7 +759,7 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf)
the_same_macaddr = !memcmp(pnetwork->network.MacAddress, the_same_macaddr = !memcmp(pnetwork->network.MacAddress,
cur_network->network.MacAddress, ETH_ALEN); cur_network->network.MacAddress, ETH_ALEN);
pnetwork->network.Length = pnetwork->network.Length =
r8712_get_ndis_wlan_bssid_ex_sz(&pnetwork->network); r8712_get_wlan_bssid_ex_sz(&pnetwork->network);
spin_lock_irqsave(&pmlmepriv->lock, irqL); spin_lock_irqsave(&pmlmepriv->lock, irqL);
if (pnetwork->network.Length > sizeof(struct wlan_bssid_ex)) if (pnetwork->network.Length > sizeof(struct wlan_bssid_ex))
goto ignore_joinbss_callback; goto ignore_joinbss_callback;
...@@ -991,7 +991,7 @@ void r8712_stadel_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -991,7 +991,7 @@ void r8712_stadel_event_callback(struct _adapter *adapter, u8 *pbuf)
pdev_network = &(adapter->registrypriv.dev_network); pdev_network = &(adapter->registrypriv.dev_network);
pibss = adapter->registrypriv.dev_network.MacAddress; pibss = adapter->registrypriv.dev_network.MacAddress;
memcpy(pdev_network, &tgt_network->network, memcpy(pdev_network, &tgt_network->network,
r8712_get_ndis_wlan_bssid_ex_sz(&tgt_network-> r8712_get_wlan_bssid_ex_sz(&tgt_network->
network)); network));
memcpy(&pdev_network->Ssid, memcpy(&pdev_network->Ssid,
&pmlmepriv->assoc_ssid, &pmlmepriv->assoc_ssid,
...@@ -1658,7 +1658,7 @@ void r8712_update_registrypriv_dev_network(struct _adapter *adapter) ...@@ -1658,7 +1658,7 @@ void r8712_update_registrypriv_dev_network(struct _adapter *adapter)
*/ */
sz = r8712_generate_ie(pregistrypriv); sz = r8712_generate_ie(pregistrypriv);
pdev_network->IELength = sz; pdev_network->IELength = sz;
pdev_network->Length = r8712_get_ndis_wlan_bssid_ex_sz(pdev_network); pdev_network->Length = r8712_get_wlan_bssid_ex_sz(pdev_network);
} }
/*the function is at passive_level*/ /*the function is at passive_level*/
......
...@@ -202,7 +202,7 @@ sint r8712_set_key(struct _adapter *adapter, ...@@ -202,7 +202,7 @@ sint r8712_set_key(struct _adapter *adapter,
struct security_priv *psecuritypriv, sint keyid); struct security_priv *psecuritypriv, sint keyid);
sint r8712_set_auth(struct _adapter *adapter, sint r8712_set_auth(struct _adapter *adapter,
struct security_priv *psecuritypriv); struct security_priv *psecuritypriv);
uint r8712_get_ndis_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss); uint r8712_get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss);
void r8712_generate_random_ibss(u8 *pibss); void r8712_generate_random_ibss(u8 *pibss);
u8 *r8712_get_capability_from_ie(u8 *ie); u8 *r8712_get_capability_from_ie(u8 *ie);
struct wlan_network *r8712_get_oldest_wlan_network( struct wlan_network *r8712_get_oldest_wlan_network(
......
...@@ -174,7 +174,7 @@ static int mp_start_test(struct _adapter *padapter) ...@@ -174,7 +174,7 @@ static int mp_start_test(struct _adapter *padapter)
bssid.InfrastructureMode = Ndis802_11IBSS; bssid.InfrastructureMode = Ndis802_11IBSS;
bssid.NetworkTypeInUse = Ndis802_11DS; bssid.NetworkTypeInUse = Ndis802_11DS;
bssid.IELength = 0; bssid.IELength = 0;
length = r8712_get_ndis_wlan_bssid_ex_sz(&bssid); length = r8712_get_wlan_bssid_ex_sz(&bssid);
if (length % 4) { if (length % 4) {
/*round up to multiple of 4 bytes.*/ /*round up to multiple of 4 bytes.*/
bssid.Length = ((length >> 2) + 1) << 2; bssid.Length = ((length >> 2) + 1) << 2;
......
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