[PATCH 4/4] Staging: rtl8712 : ieee80211.c: fixed camelcase coding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following variables and struct name
are renamed to avoid camelcase issue

Configuration to configuration
BeaconPeriod  to beacon_period
DSConfig      to ds_config
ATIMWindow    to atim_window
pnic_Config   to pnic_config
FHConfig      to fh_config
HopPattern    to hop_pattern
HopSet        to hop_set
DwellTime     to dwell_time

Signed-off-by: Jaya Durga <jayad@xxxxxxx>
---
 drivers/staging/rtl8712/ieee80211.c           |  7 ++++---
 drivers/staging/rtl8712/osdep_intf.h          |  5 ++++-
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 21 ++++++++++-----------
 drivers/staging/rtl8712/rtl871x_ioctl_rtl.c   |  8 ++++----
 drivers/staging/rtl8712/rtl871x_mlme.c        | 20 ++++++++++----------
 drivers/staging/rtl8712/wlan_bssdef.h         | 16 ++++++++--------
 6 files changed, 40 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/rtl8712/ieee80211.c b/drivers/staging/rtl8712/ieee80211.c
index f35121e..4e20de6 100644
--- a/drivers/staging/rtl8712/ieee80211.c
+++ b/drivers/staging/rtl8712/ieee80211.c
@@ -168,13 +168,14 @@ int r8712_generate_ie(struct registry_priv *pregistrypriv)
 {
 	int sz = 0, rateLen;
 	struct wlan_bssid_ex *pdev_network = &pregistrypriv->dev_network;
+	struct NDIS_802_11_CONFIGURATION *cfg = &pdev_network->configuration;
 	u8 *ie = pdev_network->IEs;
 
 	/*timestamp will be inserted by hardware*/
 	sz += 8;
 	ie += sz;
 	/*beacon interval : 2bytes*/
-	*(__le16 *)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);
+	*(__le16 *)ie = cpu_to_le16(cfg->beacon_period);
 	sz += 2;
 	ie += 2;
 	/*capability info*/
@@ -202,10 +203,10 @@ int r8712_generate_ie(struct registry_priv *pregistrypriv)
 				  rateLen, pdev_network->rates, &sz);
 	/*DS parameter set*/
 	ie = r8712_set_ie(ie, _DSSET_IE_, 1,
-			  (u8 *)&pdev_network->Configuration.DSConfig, &sz);
+			  (u8 *)&pdev_network->configuration.ds_config, &sz);
 	/*IBSS Parameter Set*/
 	ie = r8712_set_ie(ie, _IBSS_PARA_IE_, 2,
-			  (u8 *)&pdev_network->Configuration.ATIMWindow, &sz);
+			  (u8 *)&pdev_network->configuration.atim_window, &sz);
 	return sz;
 }
 
diff --git a/drivers/staging/rtl8712/osdep_intf.h b/drivers/staging/rtl8712/osdep_intf.h
index 1985423..dac6aed 100644
--- a/drivers/staging/rtl8712/osdep_intf.h
+++ b/drivers/staging/rtl8712/osdep_intf.h
@@ -29,7 +29,10 @@
 #include "osdep_service.h"
 #include "drv_types.h"
 
-#define RND4(x)	((((x) >> 2) + ((((x) & 3) == 0) ?  0 : 1)) << 2)
+static inline unsigned int RND4(unsigned int x)
+{
+	return (((x >> 2) + (((x & 3) == 0) ?  0 : 1)) << 2);
+}
 
 struct intf_priv {
 	u8 *intf_dev;
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index e30a5be..1711d66 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -150,12 +150,12 @@ static noinline_for_stack char *translate_scan(struct _adapter *padapter,
 	u16	cap, ht_cap = false, mcs_rate;
 	u8 rssi;
 
-	if ((pnetwork->network.Configuration.DSConfig < 1) ||
-	    (pnetwork->network.Configuration.DSConfig > 14)) {
-		if (pnetwork->network.Configuration.DSConfig < 1)
-			pnetwork->network.Configuration.DSConfig = 1;
+	if ((pnetwork->network.configuration.ds_config < 1) ||
+	    (pnetwork->network.configuration.ds_config > 14)) {
+		if (pnetwork->network.configuration.ds_config < 1)
+			pnetwork->network.configuration.ds_config = 1;
 		else
-			pnetwork->network.Configuration.DSConfig = 14;
+			pnetwork->network.configuration.ds_config = 14;
 	}
 	/* AP MAC address */
 	iwe.cmd = SIOCGIWAP;
@@ -212,18 +212,17 @@ static noinline_for_stack char *translate_scan(struct _adapter *padapter,
 	iwe.cmd = SIOCGIWFREQ;
 	{
 		/*  check legal index */
-		u8 dsconfig = pnetwork->network.Configuration.DSConfig;
+		u8 dsconfig = pnetwork->network.configuration.ds_config;
 
 		if (dsconfig >= 1 && dsconfig <= sizeof(
 		    ieee80211_wlan_frequencies) / sizeof(long))
 			iwe.u.freq.m = (s32)(ieee80211_wlan_frequencies[
-				       pnetwork->network.Configuration.
-				       DSConfig - 1] * 100000);
+				       dsconfig - 1] * 100000);
 		else
 			iwe.u.freq.m = 0;
 	}
 	iwe.u.freq.e = (s16)1;
-	iwe.u.freq.i = (u8)pnetwork->network.Configuration.DSConfig;
+	iwe.u.freq.i = (u8)pnetwork->network.configuration.ds_config;
 	start = iwe_stream_add_event(info, start, stop, &iwe,
 		IW_EV_FREQ_LEN);
 	/* Add encryption capability */
@@ -699,9 +698,9 @@ static int r8711_wx_get_freq(struct net_device *dev,
 		return -ENOLINK;
 
 	wrqu->freq.m = ieee80211_wlan_frequencies[
-		       pcur_bss->Configuration.DSConfig - 1] * 100000;
+		       pcur_bss->configuration.ds_config - 1] * 100000;
 	wrqu->freq.e = 1;
-	wrqu->freq.i = pcur_bss->Configuration.DSConfig;
+	wrqu->freq.i = pcur_bss->configuration.ds_config;
 
 	return 0;
 }
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_rtl.c b/drivers/staging/rtl8712/rtl871x_ioctl_rtl.c
index ca769f7..4ff3444 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_rtl.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_rtl.c
@@ -315,17 +315,17 @@ uint oid_rt_get_channel_hdl(struct oid_par_priv *poid_par_priv)
 {
 	struct _adapter *padapter = poid_par_priv->adapter_context;
 	struct	mlme_priv *pmlmepriv = &padapter->mlmepriv;
-	struct NDIS_802_11_CONFIGURATION *pnic_Config;
+	struct NDIS_802_11_CONFIGURATION *pnic_config;
 	u32   channelnum;
 
 	if (poid_par_priv->type_of_oid != QUERY_OID)
 		return RNDIS_STATUS_NOT_ACCEPTED;
 	if (check_fwstate(pmlmepriv, _FW_LINKED) ||
 	    check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))
-		pnic_Config = &pmlmepriv->cur_network.network.Configuration;
+		pnic_config = &pmlmepriv->cur_network.network.configuration;
 	else
-		pnic_Config = &padapter->registrypriv.dev_network.Configuration;
-	channelnum = pnic_Config->DSConfig;
+		pnic_config = &padapter->registrypriv.dev_network.configuration;
+	channelnum = pnic_config->ds_config;
 	*(u32 *)poid_par_priv->information_buf = channelnum;
 	*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
 	return RNDIS_STATUS_SUCCESS;
diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c
index bf1ac22..4d7dd84 100644
--- a/drivers/staging/rtl8712/rtl871x_mlme.c
+++ b/drivers/staging/rtl8712/rtl871x_mlme.c
@@ -276,8 +276,8 @@ static int is_same_network(struct wlan_bssid_ex *src,
 	memcpy((u8 *)&s_cap, r8712_get_capability_from_ie(src->IEs), 2);
 	memcpy((u8 *)&d_cap, r8712_get_capability_from_ie(dst->IEs), 2);
 	return (src->Ssid.SsidLength == dst->Ssid.SsidLength) &&
-			(src->Configuration.DSConfig ==
-			dst->Configuration.DSConfig) &&
+			(src->configuration.ds_config ==
+			dst->configuration.ds_config) &&
 			((!memcmp(src->MacAddress, dst->MacAddress,
 			ETH_ALEN))) &&
 			((!memcmp(src->Ssid.Ssid,
@@ -1615,13 +1615,13 @@ void r8712_init_registrypriv_dev_network(struct _adapter *adapter)
 	memcpy(pdev_network->MacAddress, myhwaddr, ETH_ALEN);
 	memcpy(&pdev_network->Ssid, &pregistrypriv->ssid,
 		sizeof(struct ndis_802_11_ssid));
-	pdev_network->Configuration.Length =
+	pdev_network->configuration.Length =
 			 sizeof(struct NDIS_802_11_CONFIGURATION);
-	pdev_network->Configuration.BeaconPeriod = 100;
-	pdev_network->Configuration.FHConfig.Length = 0;
-	pdev_network->Configuration.FHConfig.HopPattern = 0;
-	pdev_network->Configuration.FHConfig.HopSet = 0;
-	pdev_network->Configuration.FHConfig.DwellTime = 0;
+	pdev_network->configuration.beacon_period = 100;
+	pdev_network->configuration.fh_config.Length = 0;
+	pdev_network->configuration.fh_config.hop_pattern = 0;
+	pdev_network->configuration.fh_config.hop_set = 0;
+	pdev_network->configuration.fh_config.dwell_time = 0;
 }
 
 void r8712_update_registrypriv_dev_network(struct _adapter *adapter)
@@ -1650,9 +1650,9 @@ void r8712_update_registrypriv_dev_network(struct _adapter *adapter)
 		/* TODO */
 		break;
 	}
-	pdev_network->Configuration.DSConfig = pregistrypriv->channel;
+	pdev_network->configuration.ds_config = pregistrypriv->channel;
 	if (cur_network->network.InfrastructureMode == Ndis802_11IBSS)
-		pdev_network->Configuration.ATIMWindow = 3;
+		pdev_network->configuration.atim_window = 3;
 	pdev_network->InfrastructureMode = cur_network->network.InfrastructureMode;
 	/* 1. Supported rates
 	 * 2. IE
diff --git a/drivers/staging/rtl8712/wlan_bssdef.h b/drivers/staging/rtl8712/wlan_bssdef.h
index 9dc9ce5..8c2fa78 100644
--- a/drivers/staging/rtl8712/wlan_bssdef.h
+++ b/drivers/staging/rtl8712/wlan_bssdef.h
@@ -47,9 +47,9 @@ enum NDIS_802_11_NETWORK_TYPE {
 
 struct NDIS_802_11_CONFIGURATION_FH {
 	u32 Length;             /* Length of structure */
-	u32 HopPattern;         /* As defined by 802.11, MSB set */
-	u32 HopSet;             /* to one if non-802.11 */
-	u32 DwellTime;          /* units are Kusec */
+	u32 hop_pattern;         /* As defined by 802.11, MSB set */
+	u32 hop_set;             /* to one if non-802.11 */
+	u32 dwell_time;          /* units are Kusec */
 };
 
 /*
@@ -58,10 +58,10 @@ struct NDIS_802_11_CONFIGURATION_FH {
  */
 struct NDIS_802_11_CONFIGURATION {
 	u32 Length;             /* Length of structure */
-	u32 BeaconPeriod;       /* units are Kusec */
-	u32 ATIMWindow;         /* units are Kusec */
-	u32 DSConfig;           /* Frequency, units are kHz */
-	struct NDIS_802_11_CONFIGURATION_FH FHConfig;
+	u32 beacon_period;       /* units are Kusec */
+	u32 atim_window;         /* units are Kusec */
+	u32 ds_config;           /* Frequency, units are kHz */
+	struct NDIS_802_11_CONFIGURATION_FH fh_config;
 };
 
 enum NDIS_802_11_NETWORK_INFRASTRUCTURE {
@@ -86,7 +86,7 @@ struct wlan_bssid_ex {
 	__le32 Privacy;
 	s32 Rssi;
 	enum NDIS_802_11_NETWORK_TYPE  NetworkTypeInUse;
-	struct NDIS_802_11_CONFIGURATION  Configuration;
+	struct NDIS_802_11_CONFIGURATION  configuration;
 	enum NDIS_802_11_NETWORK_INFRASTRUCTURE  InfrastructureMode;
 	u8 rates[NDIS_802_11_LENGTH_RATES_EX];
 	/* number of content bytes in EIs, which varies */
-- 
1.9.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux