aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorBing Zhao <bzhao@marvell.com>2011-07-13 21:38:34 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-08 14:26:28 -0400
commit67a50035b3f9335b9e5800c32149173e797b9cc0 (patch)
tree2a01afd36d82e27e51955eb1b188c2e34a1baca6 /drivers/net/wireless
parent7c966a6de5be35737038cd71be7a3e36470aa52f (diff)
mwifiex: remove wireless.h inclusion and fix resulting bugs
replace IW_MAX_AP & IW_CUSTOM_MAX with local definitions and remove usage of struct iw_statistics. Cc: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c2
-rw-r--r--drivers/net/wireless/mwifiex/init.c4
-rw-r--r--drivers/net/wireless/mwifiex/ioctl.h5
-rw-r--r--drivers/net/wireless/mwifiex/main.h6
-rw-r--r--drivers/net/wireless/mwifiex/scan.c6
-rw-r--r--drivers/net/wireless/mwifiex/sta_event.c6
-rw-r--r--drivers/net/wireless/mwifiex/sta_ioctl.c18
7 files changed, 19 insertions, 28 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 352d2c5da1fc..c979a909303e 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -547,7 +547,7 @@ mwifiex_dump_station_info(struct mwifiex_private *priv,
547 sinfo->tx_bytes = priv->stats.tx_bytes; 547 sinfo->tx_bytes = priv->stats.tx_bytes;
548 sinfo->rx_packets = priv->stats.rx_packets; 548 sinfo->rx_packets = priv->stats.rx_packets;
549 sinfo->tx_packets = priv->stats.tx_packets; 549 sinfo->tx_packets = priv->stats.tx_packets;
550 sinfo->signal = priv->w_stats.qual.level; 550 sinfo->signal = priv->qual_level;
551 sinfo->txrate.legacy = rate.rate; 551 sinfo->txrate.legacy = rate.rate;
552 552
553 return ret; 553 return ret;
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index 3f1559e61320..a57c8de46d37 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -156,7 +156,7 @@ static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter)
156 struct mwifiex_bssdescriptor *temp_scan_table; 156 struct mwifiex_bssdescriptor *temp_scan_table;
157 157
158 /* Allocate buffer to store the BSSID list */ 158 /* Allocate buffer to store the BSSID list */
159 buf_size = sizeof(struct mwifiex_bssdescriptor) * IW_MAX_AP; 159 buf_size = sizeof(struct mwifiex_bssdescriptor) * MWIFIEX_MAX_AP;
160 temp_scan_table = kzalloc(buf_size, GFP_KERNEL); 160 temp_scan_table = kzalloc(buf_size, GFP_KERNEL);
161 if (!temp_scan_table) { 161 if (!temp_scan_table) {
162 dev_err(adapter->dev, "%s: failed to alloc temp_scan_table\n", 162 dev_err(adapter->dev, "%s: failed to alloc temp_scan_table\n",
@@ -224,7 +224,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
224 224
225 adapter->num_in_scan_table = 0; 225 adapter->num_in_scan_table = 0;
226 memset(adapter->scan_table, 0, 226 memset(adapter->scan_table, 0,
227 (sizeof(struct mwifiex_bssdescriptor) * IW_MAX_AP)); 227 (sizeof(struct mwifiex_bssdescriptor) * MWIFIEX_MAX_AP));
228 adapter->scan_probes = 1; 228 adapter->scan_probes = 1;
229 229
230 memset(adapter->bcn_buf, 0, sizeof(adapter->bcn_buf)); 230 memset(adapter->bcn_buf, 0, sizeof(adapter->bcn_buf));
diff --git a/drivers/net/wireless/mwifiex/ioctl.h b/drivers/net/wireless/mwifiex/ioctl.h
index 4c35aae658fe..bd9e074a1c80 100644
--- a/drivers/net/wireless/mwifiex/ioctl.h
+++ b/drivers/net/wireless/mwifiex/ioctl.h
@@ -20,7 +20,6 @@
20#ifndef _MWIFIEX_IOCTL_H_ 20#ifndef _MWIFIEX_IOCTL_H_
21#define _MWIFIEX_IOCTL_H_ 21#define _MWIFIEX_IOCTL_H_
22 22
23#include <linux/wireless.h>
24#include <net/mac80211.h> 23#include <net/mac80211.h>
25 24
26enum { 25enum {
@@ -308,10 +307,12 @@ struct mwifiex_ds_read_eeprom {
308 u8 value[MAX_EEPROM_DATA]; 307 u8 value[MAX_EEPROM_DATA];
309}; 308};
310 309
310#define IEEE_MAX_IE_SIZE 256
311
311struct mwifiex_ds_misc_gen_ie { 312struct mwifiex_ds_misc_gen_ie {
312 u32 type; 313 u32 type;
313 u32 len; 314 u32 len;
314 u8 ie_data[IW_CUSTOM_MAX]; 315 u8 ie_data[IEEE_MAX_IE_SIZE];
315}; 316};
316 317
317struct mwifiex_ds_misc_cmd { 318struct mwifiex_ds_misc_cmd {
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 2215c3c97354..e6db0475ffa2 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -54,6 +54,8 @@ struct mwifiex_drv_mode {
54}; 54};
55 55
56 56
57#define MWIFIEX_MAX_AP 64
58
57#define MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT (5 * HZ) 59#define MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT (5 * HZ)
58 60
59#define MWIFIEX_TIMER_10S 10000 61#define MWIFIEX_TIMER_10S 10000
@@ -246,8 +248,6 @@ struct ieee_types_obss_scan_param {
246 248
247#define MWIFIEX_SUPPORTED_RATES_EXT 32 249#define MWIFIEX_SUPPORTED_RATES_EXT 32
248 250
249#define IEEE_MAX_IE_SIZE 256
250
251struct ieee_types_vendor_specific { 251struct ieee_types_vendor_specific {
252 struct ieee_types_vendor_header vend_hdr; 252 struct ieee_types_vendor_header vend_hdr;
253 u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_vendor_header)]; 253 u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_vendor_header)];
@@ -468,7 +468,7 @@ struct mwifiex_private {
468 struct dentry *dfs_dev_dir; 468 struct dentry *dfs_dev_dir;
469#endif 469#endif
470 u8 nick_name[16]; 470 u8 nick_name[16];
471 struct iw_statistics w_stats; 471 u8 qual_level, qual_noise;
472 u16 current_key_index; 472 u16 current_key_index;
473 struct semaphore async_sem; 473 struct semaphore async_sem;
474 u8 scan_pending_on_block; 474 u8 scan_pending_on_block;
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 6f88c8ab5de5..1fdfd41c3100 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -2308,7 +2308,7 @@ int mwifiex_scan_networks(struct mwifiex_private *priv,
2308 2308
2309 if (!keep_previous_scan) { 2309 if (!keep_previous_scan) {
2310 memset(adapter->scan_table, 0x00, 2310 memset(adapter->scan_table, 0x00,
2311 sizeof(struct mwifiex_bssdescriptor) * IW_MAX_AP); 2311 sizeof(struct mwifiex_bssdescriptor) * MWIFIEX_MAX_AP);
2312 adapter->num_in_scan_table = 0; 2312 adapter->num_in_scan_table = 0;
2313 adapter->bcn_buf_end = adapter->bcn_buf; 2313 adapter->bcn_buf_end = adapter->bcn_buf;
2314 } 2314 }
@@ -2430,7 +2430,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
2430 scan_rsp = &resp->params.scan_resp; 2430 scan_rsp = &resp->params.scan_resp;
2431 2431
2432 2432
2433 if (scan_rsp->number_of_sets > IW_MAX_AP) { 2433 if (scan_rsp->number_of_sets > MWIFIEX_MAX_AP) {
2434 dev_err(adapter->dev, "SCAN_RESP: too many AP returned (%d)\n", 2434 dev_err(adapter->dev, "SCAN_RESP: too many AP returned (%d)\n",
2435 scan_rsp->number_of_sets); 2435 scan_rsp->number_of_sets);
2436 ret = -1; 2436 ret = -1;
@@ -2542,7 +2542,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
2542 if (bss_idx == num_in_table) { 2542 if (bss_idx == num_in_table) {
2543 /* Range check the bss_idx, keep it limited to 2543 /* Range check the bss_idx, keep it limited to
2544 the last entry */ 2544 the last entry */
2545 if (bss_idx == IW_MAX_AP) 2545 if (bss_idx == MWIFIEX_MAX_AP)
2546 bss_idx--; 2546 bss_idx--;
2547 else 2547 else
2548 num_in_table++; 2548 num_in_table++;
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c
index fc265cab0907..6e8b198490b0 100644
--- a/drivers/net/wireless/mwifiex/sta_event.c
+++ b/drivers/net/wireless/mwifiex/sta_event.c
@@ -130,8 +130,8 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv)
130 if (netif_carrier_ok(priv->netdev)) 130 if (netif_carrier_ok(priv->netdev))
131 netif_carrier_off(priv->netdev); 131 netif_carrier_off(priv->netdev);
132 /* Reset wireless stats signal info */ 132 /* Reset wireless stats signal info */
133 priv->w_stats.qual.level = 0; 133 priv->qual_level = 0;
134 priv->w_stats.qual.noise = 0; 134 priv->qual_noise = 0;
135} 135}
136 136
137/* 137/*
@@ -301,7 +301,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
301 dev_dbg(adapter->dev, "event: BGS_REPORT\n"); 301 dev_dbg(adapter->dev, "event: BGS_REPORT\n");
302 /* Clear the previous scan result */ 302 /* Clear the previous scan result */
303 memset(adapter->scan_table, 0x00, 303 memset(adapter->scan_table, 0x00,
304 sizeof(struct mwifiex_bssdescriptor) * IW_MAX_AP); 304 sizeof(struct mwifiex_bssdescriptor) * MWIFIEX_MAX_AP);
305 adapter->num_in_scan_table = 0; 305 adapter->num_in_scan_table = 0;
306 adapter->bcn_buf_end = adapter->bcn_buf; 306 adapter->bcn_buf_end = adapter->bcn_buf;
307 ret = mwifiex_send_cmd_async(priv, 307 ret = mwifiex_send_cmd_async(priv,
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index c34ff8c4f4f8..10ef9e9dfefe 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -1280,9 +1280,9 @@ int mwifiex_get_signal_info(struct mwifiex_private *priv,
1280 1280
1281 if (!status) { 1281 if (!status) {
1282 if (signal->selector & BCN_RSSI_AVG_MASK) 1282 if (signal->selector & BCN_RSSI_AVG_MASK)
1283 priv->w_stats.qual.level = signal->bcn_rssi_avg; 1283 priv->qual_level = signal->bcn_rssi_avg;
1284 if (signal->selector & BCN_NF_AVG_MASK) 1284 if (signal->selector & BCN_NF_AVG_MASK)
1285 priv->w_stats.qual.noise = signal->bcn_nf_avg; 1285 priv->qual_noise = signal->bcn_nf_avg;
1286 } 1286 }
1287 1287
1288 return status; 1288 return status;
@@ -1341,18 +1341,8 @@ int
1341mwifiex_get_stats_info(struct mwifiex_private *priv, 1341mwifiex_get_stats_info(struct mwifiex_private *priv,
1342 struct mwifiex_ds_get_stats *log) 1342 struct mwifiex_ds_get_stats *log)
1343{ 1343{
1344 int ret; 1344 return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_GET_LOG,
1345
1346 ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_GET_LOG,
1347 HostCmd_ACT_GEN_GET, 0, log); 1345 HostCmd_ACT_GEN_GET, 0, log);
1348
1349 if (!ret) {
1350 priv->w_stats.discard.fragment = log->fcs_error;
1351 priv->w_stats.discard.retries = log->retry;
1352 priv->w_stats.discard.misc = log->ack_failure;
1353 }
1354
1355 return ret;
1356} 1346}
1357 1347
1358/* 1348/*
@@ -1594,7 +1584,7 @@ mwifiex_set_gen_ie(struct mwifiex_private *priv, u8 *ie, int ie_len)
1594{ 1584{
1595 struct mwifiex_ds_misc_gen_ie gen_ie; 1585 struct mwifiex_ds_misc_gen_ie gen_ie;
1596 1586
1597 if (ie_len > IW_CUSTOM_MAX) 1587 if (ie_len > IEEE_MAX_IE_SIZE)
1598 return -EFAULT; 1588 return -EFAULT;
1599 1589
1600 gen_ie.type = MWIFIEX_IE_TYPE_GEN_IE; 1590 gen_ie.type = MWIFIEX_IE_TYPE_GEN_IE;