aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
diff options
context:
space:
mode:
authorFrank Seidel <frank@f-seidel.de>2009-03-01 14:25:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-03-05 14:39:37 -0500
commita412c8040d83366dcc24962207b8beed52f29344 (patch)
treef5a3c04cc85662f01ec32790df3c6dbc6f0f18b0 /drivers/net/wireless/iwlwifi/iwl-agn-rs.c
parent64abd80330baba9d87df2b952a7eec5af5158470 (diff)
iwlwifi: reduce stack size
Reduce stack memory footprint of iwlwifi. (From >1000 bytes for each *_table_read on i386 down to 32) Signed-off-by: Frank Seidel <frank@f-seidel.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-rs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 04b42c8a7705..99da40678878 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -2520,12 +2520,17 @@ static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file,
2520static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file, 2520static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
2521 char __user *user_buf, size_t count, loff_t *ppos) 2521 char __user *user_buf, size_t count, loff_t *ppos)
2522{ 2522{
2523 char buff[1024]; 2523 char *buff;
2524 int desc = 0; 2524 int desc = 0;
2525 int i = 0; 2525 int i = 0;
2526 ssize_t ret;
2526 2527
2527 struct iwl_lq_sta *lq_sta = file->private_data; 2528 struct iwl_lq_sta *lq_sta = file->private_data;
2528 2529
2530 buff = kmalloc(1024, GFP_KERNEL);
2531 if (!buff)
2532 return -ENOMEM;
2533
2529 desc += sprintf(buff+desc, "sta_id %d\n", lq_sta->lq.sta_id); 2534 desc += sprintf(buff+desc, "sta_id %d\n", lq_sta->lq.sta_id);
2530 desc += sprintf(buff+desc, "failed=%d success=%d rate=0%X\n", 2535 desc += sprintf(buff+desc, "failed=%d success=%d rate=0%X\n",
2531 lq_sta->total_failed, lq_sta->total_success, 2536 lq_sta->total_failed, lq_sta->total_success,
@@ -2557,7 +2562,9 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
2557 desc += sprintf(buff+desc, " rate[%d] 0x%X\n", 2562 desc += sprintf(buff+desc, " rate[%d] 0x%X\n",
2558 i, le32_to_cpu(lq_sta->lq.rs_table[i].rate_n_flags)); 2563 i, le32_to_cpu(lq_sta->lq.rs_table[i].rate_n_flags));
2559 2564
2560 return simple_read_from_buffer(user_buf, count, ppos, buff, desc); 2565 ret = simple_read_from_buffer(user_buf, count, ppos, buff, desc);
2566 kfree(buff);
2567 return ret;
2561} 2568}
2562 2569
2563static const struct file_operations rs_sta_dbgfs_scale_table_ops = { 2570static const struct file_operations rs_sta_dbgfs_scale_table_ops = {
@@ -2568,11 +2575,17 @@ static const struct file_operations rs_sta_dbgfs_scale_table_ops = {
2568static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file, 2575static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file,
2569 char __user *user_buf, size_t count, loff_t *ppos) 2576 char __user *user_buf, size_t count, loff_t *ppos)
2570{ 2577{
2571 char buff[1024]; 2578 char *buff;
2572 int desc = 0; 2579 int desc = 0;
2573 int i, j; 2580 int i, j;
2581 ssize_t ret;
2574 2582
2575 struct iwl_lq_sta *lq_sta = file->private_data; 2583 struct iwl_lq_sta *lq_sta = file->private_data;
2584
2585 buff = kmalloc(1024, GFP_KERNEL);
2586 if (!buff)
2587 return -ENOMEM;
2588
2576 for (i = 0; i < LQ_SIZE; i++) { 2589 for (i = 0; i < LQ_SIZE; i++) {
2577 desc += sprintf(buff+desc, "%s type=%d SGI=%d FAT=%d DUP=%d\n" 2590 desc += sprintf(buff+desc, "%s type=%d SGI=%d FAT=%d DUP=%d\n"
2578 "rate=0x%X\n", 2591 "rate=0x%X\n",
@@ -2590,7 +2603,9 @@ static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file,
2590 lq_sta->lq_info[i].win[j].success_ratio); 2603 lq_sta->lq_info[i].win[j].success_ratio);
2591 } 2604 }
2592 } 2605 }
2593 return simple_read_from_buffer(user_buf, count, ppos, buff, desc); 2606 ret = simple_read_from_buffer(user_buf, count, ppos, buff, desc);
2607 kfree(buff);
2608 return ret;
2594} 2609}
2595 2610
2596static const struct file_operations rs_sta_dbgfs_stats_table_ops = { 2611static const struct file_operations rs_sta_dbgfs_stats_table_ops = {