aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8187se/r8180_wx.c
diff options
context:
space:
mode:
authorAndrew Miller <amiller@amilx.com>2012-03-15 19:32:08 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-15 19:46:55 -0400
commit40ec6c542121ef85f5ba2e7d75968806009dcaf7 (patch)
tree52cb00e10ca61b5acde6f559ba61638265ef1738 /drivers/staging/rtl8187se/r8180_wx.c
parente7e298e86ead71558c277541977bd352bf309b41 (diff)
Staging: rtl8187se: r8180_wx.c: Cleaned up comments
Realigned some comments and removed small bit of old comments that I missed in my last commit Signed-off-by: Andrew Miller <amiller@amilx.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8187se/r8180_wx.c')
-rw-r--r--drivers/staging/rtl8187se/r8180_wx.c121
1 files changed, 59 insertions, 62 deletions
diff --git a/drivers/staging/rtl8187se/r8180_wx.c b/drivers/staging/rtl8187se/r8180_wx.c
index 9d03cfb3e9a..303ec691262 100644
--- a/drivers/staging/rtl8187se/r8180_wx.c
+++ b/drivers/staging/rtl8187se/r8180_wx.c
@@ -29,16 +29,16 @@ u32 rtl8180_rates[] = {1000000, 2000000, 5500000, 11000000,
29#define RATE_COUNT ARRAY_SIZE(rtl8180_rates) 29#define RATE_COUNT ARRAY_SIZE(rtl8180_rates)
30 30
31static CHANNEL_LIST DefaultChannelPlan[] = { 31static CHANNEL_LIST DefaultChannelPlan[] = {
32 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 52, 56, 60, 64}, 19}, /*FCC */ 32 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 52, 56, 60, 64}, 19}, /* FCC */
33 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 11}, /*IC */ 33 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 11}, /* IC */
34 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56, 60, 64}, 21}, /*ETSI */ 34 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56, 60, 64}, 21}, /* ETSI */
35 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56, 60, 64}, 21}, /*Spain. Change to ETSI. */ 35 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56, 60, 64}, 21}, /* Spain. Change to ETSI. */
36 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56, 60, 64}, 21}, /*France. Change to ETSI. */ 36 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56, 60, 64}, 21}, /* France. Change to ETSI. */
37 {{14, 36, 40, 44, 48, 52, 56, 60, 64}, 9}, /*MKK */ 37 {{14, 36, 40, 44, 48, 52, 56, 60, 64}, 9}, /* MKK */
38 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 56, 60, 64}, 22},/*MKK1 */ 38 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 56, 60, 64}, 22}, /* MKK1 */
39 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56, 60, 64}, 21}, /*Israel. */ 39 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56, 60, 64}, 21}, /* Israel */
40 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 34, 38, 42, 46}, 17}, /*For 11a , TELEC */ 40 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 34, 38, 42, 46}, 17}, /* For 11a , TELEC */
41 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 14} /*For Global Domain. 1-11:active scan, 12-14 passive scan.*/ /* +YJ, 080626 */ 41 {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 14} /* For Global Domain. 1-11:active scan, 12-14 passive scan.*/ /* +YJ, 080626 */
42}; 42};
43static int r8180_wx_get_freq(struct net_device *dev, 43static int r8180_wx_get_freq(struct net_device *dev,
44 struct iw_request_info *a, 44 struct iw_request_info *a,
@@ -195,18 +195,20 @@ static int r8180_wx_set_mode(struct net_device *dev, struct iw_request_info *a,
195 195
196/* YJ,add,080819,for hidden ap */ 196/* YJ,add,080819,for hidden ap */
197struct iw_range_with_scan_capa { 197struct iw_range_with_scan_capa {
198 /* Informative stuff (to choose between different interface) */ 198 /* Informative stuff (to choose between different interface) */
199 __u32 throughput; /* To give an idea... */ 199
200 __u32 throughput; /* To give an idea... */
201
200 /* In theory this value should be the maximum benchmarked 202 /* In theory this value should be the maximum benchmarked
201 * TCP/IP throughput, because with most of these devices the 203 * TCP/IP throughput, because with most of these devices the
202 * bit rate is meaningless (overhead an co) to estimate how 204 * bit rate is meaningless (overhead an co) to estimate how
203 * fast the connection will go and pick the fastest one. 205 * fast the connection will go and pick the fastest one.
204 * I suggest people to play with Netperf or any benchmark... 206 * I suggest people to play with Netperf or any benchmark...
205 */ 207 */
206 208
207 /* NWID (or domain id) */ 209 /* NWID (or domain id) */
208 __u32 min_nwid; /* Minimal NWID we are able to set */ 210 __u32 min_nwid; /* Minimal NWID we are able to set */
209 __u32 max_nwid; /* Maximal NWID we are able to set */ 211 __u32 max_nwid; /* Maximal NWID we are able to set */
210 212
211 /* Old Frequency (backward compat - moved lower ) */ 213 /* Old Frequency (backward compat - moved lower ) */
212 __u16 old_num_channels; 214 __u16 old_num_channels;
@@ -289,8 +291,8 @@ static int rtl8180_wx_get_range(struct net_device *dev,
289 range->freq[val].e = 1; 291 range->freq[val].e = 1;
290 val++; 292 val++;
291 } else { 293 } else {
292 /* FIXME: do we need to set anything for channels */ 294 /* FIXME: do we need to set anything for channels */
293 /* we don't use ? */ 295 /* we don't use ? */
294 } 296 }
295 297
296 if (val == IW_MAX_FREQUENCIES) 298 if (val == IW_MAX_FREQUENCIES)
@@ -1016,7 +1018,6 @@ static int r8180_wx_set_channelplan(struct net_device *dev,
1016 union iwreq_data *wrqu, char *extra) 1018 union iwreq_data *wrqu, char *extra)
1017{ 1019{
1018 struct r8180_priv *priv = ieee80211_priv(dev); 1020 struct r8180_priv *priv = ieee80211_priv(dev);
1019 /* struct ieee80211_device *ieee = netdev_priv(dev); */
1020 int *val = (int *)extra; 1021 int *val = (int *)extra;
1021 int i; 1022 int i;
1022 printk("-----in fun %s\n", __func__); 1023 printk("-----in fun %s\n", __func__);
@@ -1105,7 +1106,6 @@ static int r8180_wx_set_auth(struct net_device *dev,
1105 struct iw_request_info *info, 1106 struct iw_request_info *info,
1106 union iwreq_data *wrqu, char *extra) 1107 union iwreq_data *wrqu, char *extra)
1107{ 1108{
1108 /* printk("====>%s()\n", __func__); */
1109 struct r8180_priv *priv = ieee80211_priv(dev); 1109 struct r8180_priv *priv = ieee80211_priv(dev);
1110 int ret = 0; 1110 int ret = 0;
1111 1111
@@ -1158,62 +1158,62 @@ static int r8180_wx_set_gen_ie(struct net_device *dev,
1158 1158
1159} 1159}
1160static iw_handler r8180_wx_handlers[] = { 1160static iw_handler r8180_wx_handlers[] = {
1161 NULL, /* SIOCSIWCOMMIT */ 1161 NULL, /* SIOCSIWCOMMIT */
1162 r8180_wx_get_name, /* SIOCGIWNAME */ 1162 r8180_wx_get_name, /* SIOCGIWNAME */
1163 dummy, /* SIOCSIWNWID */ 1163 dummy, /* SIOCSIWNWID */
1164 dummy, /* SIOCGIWNWID */ 1164 dummy, /* SIOCGIWNWID */
1165 r8180_wx_set_freq, /* SIOCSIWFREQ */ 1165 r8180_wx_set_freq, /* SIOCSIWFREQ */
1166 r8180_wx_get_freq, /* SIOCGIWFREQ */ 1166 r8180_wx_get_freq, /* SIOCGIWFREQ */
1167 r8180_wx_set_mode, /* SIOCSIWMODE */ 1167 r8180_wx_set_mode, /* SIOCSIWMODE */
1168 r8180_wx_get_mode, /* SIOCGIWMODE */ 1168 r8180_wx_get_mode, /* SIOCGIWMODE */
1169 r8180_wx_set_sens, /* SIOCSIWSENS */ 1169 r8180_wx_set_sens, /* SIOCSIWSENS */
1170 r8180_wx_get_sens, /* SIOCGIWSENS */ 1170 r8180_wx_get_sens, /* SIOCGIWSENS */
1171 NULL, /* SIOCSIWRANGE */ 1171 NULL, /* SIOCSIWRANGE */
1172 rtl8180_wx_get_range, /* SIOCGIWRANGE */ 1172 rtl8180_wx_get_range, /* SIOCGIWRANGE */
1173 NULL, /* SIOCSIWPRIV */ 1173 NULL, /* SIOCSIWPRIV */
1174 NULL, /* SIOCGIWPRIV */ 1174 NULL, /* SIOCGIWPRIV */
1175 NULL, /* SIOCSIWSTATS */ 1175 NULL, /* SIOCSIWSTATS */
1176 NULL, /* SIOCGIWSTATS */ 1176 NULL, /* SIOCGIWSTATS */
1177 dummy, /* SIOCSIWSPY */ 1177 dummy, /* SIOCSIWSPY */
1178 dummy, /* SIOCGIWSPY */ 1178 dummy, /* SIOCGIWSPY */
1179 NULL, /* SIOCGIWTHRSPY */ 1179 NULL, /* SIOCGIWTHRSPY */
1180 NULL, /* SIOCWIWTHRSPY */ 1180 NULL, /* SIOCWIWTHRSPY */
1181 r8180_wx_set_wap, /* SIOCSIWAP */ 1181 r8180_wx_set_wap, /* SIOCSIWAP */
1182 r8180_wx_get_wap, /* SIOCGIWAP */ 1182 r8180_wx_get_wap, /* SIOCGIWAP */
1183 r8180_wx_set_mlme, /* SIOCSIWMLME*/ 1183 r8180_wx_set_mlme, /* SIOCSIWMLME*/
1184 dummy, /* SIOCGIWAPLIST -- depricated */ 1184 dummy, /* SIOCGIWAPLIST -- depricated */
1185 r8180_wx_set_scan, /* SIOCSIWSCAN */ 1185 r8180_wx_set_scan, /* SIOCSIWSCAN */
1186 r8180_wx_get_scan, /* SIOCGIWSCAN */ 1186 r8180_wx_get_scan, /* SIOCGIWSCAN */
1187 r8180_wx_set_essid, /* SIOCSIWESSID */ 1187 r8180_wx_set_essid, /* SIOCSIWESSID */
1188 r8180_wx_get_essid, /* SIOCGIWESSID */ 1188 r8180_wx_get_essid, /* SIOCGIWESSID */
1189 dummy, /* SIOCSIWNICKN */ 1189 dummy, /* SIOCSIWNICKN */
1190 dummy, /* SIOCGIWNICKN */ 1190 dummy, /* SIOCGIWNICKN */
1191 NULL, /* -- hole -- */ 1191 NULL, /* -- hole -- */
1192 NULL, /* -- hole -- */ 1192 NULL, /* -- hole -- */
1193 r8180_wx_set_rate, /* SIOCSIWRATE */ 1193 r8180_wx_set_rate, /* SIOCSIWRATE */
1194 r8180_wx_get_rate, /* SIOCGIWRATE */ 1194 r8180_wx_get_rate, /* SIOCGIWRATE */
1195 r8180_wx_set_rts, /* SIOCSIWRTS */ 1195 r8180_wx_set_rts, /* SIOCSIWRTS */
1196 r8180_wx_get_rts, /* SIOCGIWRTS */ 1196 r8180_wx_get_rts, /* SIOCGIWRTS */
1197 r8180_wx_set_frag, /* SIOCSIWFRAG */ 1197 r8180_wx_set_frag, /* SIOCSIWFRAG */
1198 r8180_wx_get_frag, /* SIOCGIWFRAG */ 1198 r8180_wx_get_frag, /* SIOCGIWFRAG */
1199 dummy, /* SIOCSIWTXPOW */ 1199 dummy, /* SIOCSIWTXPOW */
1200 dummy, /* SIOCGIWTXPOW */ 1200 dummy, /* SIOCGIWTXPOW */
1201 r8180_wx_set_retry, /* SIOCSIWRETRY */ 1201 r8180_wx_set_retry, /* SIOCSIWRETRY */
1202 r8180_wx_get_retry, /* SIOCGIWRETRY */ 1202 r8180_wx_get_retry, /* SIOCGIWRETRY */
1203 r8180_wx_set_enc, /* SIOCSIWENCODE */ 1203 r8180_wx_set_enc, /* SIOCSIWENCODE */
1204 r8180_wx_get_enc, /* SIOCGIWENCODE */ 1204 r8180_wx_get_enc, /* SIOCGIWENCODE */
1205 r8180_wx_set_power, /* SIOCSIWPOWER */ 1205 r8180_wx_set_power, /* SIOCSIWPOWER */
1206 r8180_wx_get_power, /* SIOCGIWPOWER */ 1206 r8180_wx_get_power, /* SIOCGIWPOWER */
1207 NULL, /*---hole---*/ 1207 NULL, /*---hole---*/
1208 NULL, /*---hole---*/ 1208 NULL, /*---hole---*/
1209 r8180_wx_set_gen_ie, /* SIOCSIWGENIE */ 1209 r8180_wx_set_gen_ie, /* SIOCSIWGENIE */
1210 NULL, /* SIOCSIWGENIE */ 1210 NULL, /* SIOCSIWGENIE */
1211 r8180_wx_set_auth, /* SIOCSIWAUTH */ 1211 r8180_wx_set_auth, /* SIOCSIWAUTH */
1212 NULL, /* SIOCSIWAUTH */ 1212 NULL, /* SIOCSIWAUTH */
1213 r8180_wx_set_enc_ext, /* SIOCSIWENCODEEXT */ 1213 r8180_wx_set_enc_ext, /* SIOCSIWENCODEEXT */
1214 NULL, /* SIOCSIWENCODEEXT */ 1214 NULL, /* SIOCSIWENCODEEXT */
1215 NULL, /* SIOCSIWPMKSA */ 1215 NULL, /* SIOCSIWPMKSA */
1216 NULL, /*---hole---*/ 1216 NULL, /*---hole---*/
1217}; 1217};
1218 1218
1219 1219
@@ -1322,7 +1322,7 @@ static const struct iw_priv_args r8180_private_args[] = {
1322 1322
1323 1323
1324static iw_handler r8180_private_handler[] = { 1324static iw_handler r8180_private_handler[] = {
1325 r8180_wx_set_crcmon, /*SIOCIWSECONDPRIV*/ 1325 r8180_wx_set_crcmon, /*SIOCIWSECONDPRIV*/
1326 dummy, 1326 dummy,
1327 r8180_wx_set_beaconinterval, 1327 r8180_wx_set_beaconinterval,
1328 dummy, 1328 dummy,
@@ -1354,16 +1354,15 @@ static inline int is_same_network(struct ieee80211_network *src,
1354 struct ieee80211_network *dst, 1354 struct ieee80211_network *dst,
1355 struct ieee80211_device *ieee) 1355 struct ieee80211_device *ieee)
1356{ 1356{
1357 /* A network is only a duplicate if the channel, BSSID, ESSID 1357 /* A network is only a duplicate if the channel, BSSID, ESSID
1358 * and the capability field (in particular IBSS and BSS) all match. 1358 * and the capability field (in particular IBSS and BSS) all match.
1359 * We treat all <hidden> with the same BSSID and channel 1359 * We treat all <hidden> with the same BSSID and channel
1360 * as one network */ 1360 * as one network
1361 return (((src->ssid_len == dst->ssid_len) || (ieee->iw_mode == IW_MODE_INFRA)) && /* YJ,mod, 080819,for hidden ap */ 1361 */
1362 /* ((src->ssid_len == dst->ssid_len) && */ 1362 return (((src->ssid_len == dst->ssid_len) || (ieee->iw_mode == IW_MODE_INFRA)) && /* YJ,mod, 080819,for hidden ap */
1363 (src->channel == dst->channel) && 1363 (src->channel == dst->channel) &&
1364 !memcmp(src->bssid, dst->bssid, ETH_ALEN) && 1364 !memcmp(src->bssid, dst->bssid, ETH_ALEN) &&
1365 (!memcmp(src->ssid, dst->ssid, src->ssid_len) || (ieee->iw_mode == IW_MODE_INFRA)) && /* YJ,mod, 080819,for hidden ap */ 1365 (!memcmp(src->ssid, dst->ssid, src->ssid_len) || (ieee->iw_mode == IW_MODE_INFRA)) && /* YJ,mod, 080819,for hidden ap */
1366 /*!memcmp(src->ssid, dst->ssid, src->ssid_len) && */
1367 ((src->capability & WLAN_CAPABILITY_IBSS) == 1366 ((src->capability & WLAN_CAPABILITY_IBSS) ==
1368 (dst->capability & WLAN_CAPABILITY_IBSS)) && 1367 (dst->capability & WLAN_CAPABILITY_IBSS)) &&
1369 ((src->capability & WLAN_CAPABILITY_BSS) == 1368 ((src->capability & WLAN_CAPABILITY_BSS) ==
@@ -1376,11 +1375,9 @@ static struct iw_statistics *r8180_get_wireless_stats(struct net_device *dev)
1376 struct r8180_priv *priv = ieee80211_priv(dev); 1375 struct r8180_priv *priv = ieee80211_priv(dev);
1377 struct ieee80211_device* ieee = priv->ieee80211; 1376 struct ieee80211_device* ieee = priv->ieee80211;
1378 struct iw_statistics* wstats = &priv->wstats; 1377 struct iw_statistics* wstats = &priv->wstats;
1379 /* struct ieee80211_network* target = NULL; */
1380 int tmp_level = 0; 1378 int tmp_level = 0;
1381 int tmp_qual = 0; 1379 int tmp_qual = 0;
1382 int tmp_noise = 0; 1380 int tmp_noise = 0;
1383 /* unsigned long flag; */
1384 1381
1385 if (ieee->state < IEEE80211_LINKED) { 1382 if (ieee->state < IEEE80211_LINKED) {
1386 wstats->qual.qual = 0; 1383 wstats->qual.qual = 0;