Commit 56f14114 authored by Ana Rey's avatar Ana Rey Committed by Greg Kroah-Hartman
Browse files

staging: rtl8187se: Convert CHANNEL_LIST typedef into a struct.



The Documentation/CodingStyle doesn't recommend the use of typedef, convert
this to structure.

While at it, I have also renamed the variable names that were used in
this typedef not to use Hungarian notation.

Signed-off-by: default avatarAna Rey <anarey@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 899e5f9b
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -709,10 +709,10 @@ enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame};


#define MAX_IE_LEN						0xFF //+YJ,080625
#define MAX_IE_LEN						0xFF //+YJ,080625


typedef struct _CHANNEL_LIST{
struct rtl8187se_channel_list {
	u8	Channel[MAX_CHANNEL_NUMBER + 1];
	u8	channel[MAX_CHANNEL_NUMBER + 1];
	u8	Len;
	u8	len;
}CHANNEL_LIST, *PCHANNEL_LIST;
};


//by amy for ps
//by amy for ps
#define IEEE80211_WATCH_DOG_TIME    2000
#define IEEE80211_WATCH_DOG_TIME    2000
+5 −5
Original line number Original line Diff line number Diff line
@@ -2176,7 +2176,7 @@ static void watch_dog_adaptive(unsigned long data)
	add_timer(&priv->watch_dog_timer);
	add_timer(&priv->watch_dog_timer);
}
}


static CHANNEL_LIST ChannelPlan[] = {
static struct rtl8187se_channel_list channel_plan_list[] = {
	{{1,2,3,4,5,6,7,8,9,10,11,36,40,44,48,52,56,60,64},19},		/* FCC */
	{{1,2,3,4,5,6,7,8,9,10,11,36,40,44,48,52,56,60,64},19},		/* FCC */
	{{1,2,3,4,5,6,7,8,9,10,11},11},					/* IC */
	{{1,2,3,4,5,6,7,8,9,10,11},11},					/* IC */
	{{1,2,3,4,5,6,7,8,9,10,11,12,13,36,40,44,48,52,56,60,64},21},	/* ETSI */
	{{1,2,3,4,5,6,7,8,9,10,11,12,13,36,40,44,48,52,56,60,64},21},	/* ETSI */
@@ -2212,13 +2212,13 @@ static void rtl8180_set_channel_map(u8 channel_plan,
		{
		{
			Dot11d_Init(ieee);
			Dot11d_Init(ieee);
			ieee->bGlobalDomain = false;
			ieee->bGlobalDomain = false;
			if (ChannelPlan[channel_plan].Len != 0) {
			if (channel_plan_list[channel_plan].len != 0) {
				/* Clear old channel map */
				/* Clear old channel map */
				memset(GET_DOT11D_INFO(ieee)->channel_map, 0, sizeof(GET_DOT11D_INFO(ieee)->channel_map));
				memset(GET_DOT11D_INFO(ieee)->channel_map, 0, sizeof(GET_DOT11D_INFO(ieee)->channel_map));
				/* Set new channel map */
				/* Set new channel map */
				for (i = 0; i < ChannelPlan[channel_plan].Len; i++) {
				for (i = 0; i < channel_plan_list[channel_plan].len; i++) {
					if (ChannelPlan[channel_plan].Channel[i] <= 14)
					if (channel_plan_list[channel_plan].channel[i] <= 14)
						GET_DOT11D_INFO(ieee)->channel_map[ChannelPlan[channel_plan].Channel[i]] = 1;
						GET_DOT11D_INFO(ieee)->channel_map[channel_plan_list[channel_plan].channel[i]] = 1;
				}
				}
			}
			}
			break;
			break;
+4 −4
Original line number Original line Diff line number Diff line
@@ -29,7 +29,7 @@ static u32 rtl8180_rates[] = {1000000, 2000000, 5500000, 11000000,


#define RATE_COUNT ARRAY_SIZE(rtl8180_rates)
#define RATE_COUNT ARRAY_SIZE(rtl8180_rates)


static CHANNEL_LIST DefaultChannelPlan[] = {
static struct rtl8187se_channel_list default_channel_plan[] = {
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 52, 56, 60, 64}, 19},		/* FCC */
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 52, 56, 60, 64}, 19},		/* FCC */
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 11},						/* IC */
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 11},						/* IC */
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56, 60, 64}, 21},	/* ETSI	*/
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56, 60, 64}, 21},	/* ETSI	*/
@@ -1030,15 +1030,15 @@ static int r8180_wx_set_channelplan(struct net_device *dev,


	/* unsigned long flags; */
	/* unsigned long flags; */
	down(&priv->wx_sem);
	down(&priv->wx_sem);
	if (DefaultChannelPlan[*val].Len != 0)	{
	if (default_channel_plan[*val].len != 0) {
		priv->channel_plan = *val;
		priv->channel_plan = *val;
		/* Clear old channel map 8 */
		/* Clear old channel map 8 */
		for (i = 1; i <= MAX_CHANNEL_NUMBER; i++)
		for (i = 1; i <= MAX_CHANNEL_NUMBER; i++)
			GET_DOT11D_INFO(priv->ieee80211)->channel_map[i] = 0;
			GET_DOT11D_INFO(priv->ieee80211)->channel_map[i] = 0;


		/* Set new channel map */
		/* Set new channel map */
		for (i = 1; i <= DefaultChannelPlan[*val].Len; i++)
		for (i = 1; i <= default_channel_plan[*val].len; i++)
			GET_DOT11D_INFO(priv->ieee80211)->channel_map[DefaultChannelPlan[*val].Channel[i-1]] = 1;
			GET_DOT11D_INFO(priv->ieee80211)->channel_map[default_channel_plan[*val].channel[i-1]] = 1;


	}
	}
	up(&priv->wx_sem);
	up(&priv->wx_sem);