diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-12-08 15:04:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:06:19 -0500 |
commit | aa21c004f80bdf943736c62dccf0c0398d7824f3 (patch) | |
tree | 6815328775d3b5ec46bb342c4c256cde0f223863 /drivers/net/wireless/libertas/debugfs.c | |
parent | f86a93e1b2d05a7a38a48c91f8fb8fc7e8f1c734 (diff) |
libertas: kill struct lbs_adapter
There seems to be no reason for a separate structure; move it all
into struct lbs_private.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/debugfs.c')
-rw-r--r-- | drivers/net/wireless/libertas/debugfs.c | 56 |
1 files changed, 26 insertions, 30 deletions
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c index 9a041e5b209c..fe422b28a4f8 100644 --- a/drivers/net/wireless/libertas/debugfs.c +++ b/drivers/net/wireless/libertas/debugfs.c | |||
@@ -45,9 +45,9 @@ static ssize_t lbs_dev_info(struct file *file, char __user *userbuf, | |||
45 | ssize_t res; | 45 | ssize_t res; |
46 | 46 | ||
47 | pos += snprintf(buf+pos, len-pos, "state = %s\n", | 47 | pos += snprintf(buf+pos, len-pos, "state = %s\n", |
48 | szStates[priv->adapter->connect_status]); | 48 | szStates[priv->connect_status]); |
49 | pos += snprintf(buf+pos, len-pos, "region_code = %02x\n", | 49 | pos += snprintf(buf+pos, len-pos, "region_code = %02x\n", |
50 | (u32) priv->adapter->regioncode); | 50 | (u32) priv->regioncode); |
51 | 51 | ||
52 | res = simple_read_from_buffer(userbuf, count, ppos, buf, pos); | 52 | res = simple_read_from_buffer(userbuf, count, ppos, buf, pos); |
53 | 53 | ||
@@ -70,8 +70,8 @@ static ssize_t lbs_getscantable(struct file *file, char __user *userbuf, | |||
70 | pos += snprintf(buf+pos, len-pos, | 70 | pos += snprintf(buf+pos, len-pos, |
71 | "# | ch | rssi | bssid | cap | Qual | SSID \n"); | 71 | "# | ch | rssi | bssid | cap | Qual | SSID \n"); |
72 | 72 | ||
73 | mutex_lock(&priv->adapter->lock); | 73 | mutex_lock(&priv->lock); |
74 | list_for_each_entry (iter_bss, &priv->adapter->network_list, list) { | 74 | list_for_each_entry (iter_bss, &priv->network_list, list) { |
75 | u16 ibss = (iter_bss->capability & WLAN_CAPABILITY_IBSS); | 75 | u16 ibss = (iter_bss->capability & WLAN_CAPABILITY_IBSS); |
76 | u16 privacy = (iter_bss->capability & WLAN_CAPABILITY_PRIVACY); | 76 | u16 privacy = (iter_bss->capability & WLAN_CAPABILITY_PRIVACY); |
77 | u16 spectrum_mgmt = (iter_bss->capability & WLAN_CAPABILITY_SPECTRUM_MGMT); | 77 | u16 spectrum_mgmt = (iter_bss->capability & WLAN_CAPABILITY_SPECTRUM_MGMT); |
@@ -90,7 +90,7 @@ static ssize_t lbs_getscantable(struct file *file, char __user *userbuf, | |||
90 | 90 | ||
91 | numscansdone++; | 91 | numscansdone++; |
92 | } | 92 | } |
93 | mutex_unlock(&priv->adapter->lock); | 93 | mutex_unlock(&priv->lock); |
94 | 94 | ||
95 | res = simple_read_from_buffer(userbuf, count, ppos, buf, pos); | 95 | res = simple_read_from_buffer(userbuf, count, ppos, buf, pos); |
96 | 96 | ||
@@ -118,12 +118,12 @@ static ssize_t lbs_sleepparams_write(struct file *file, | |||
118 | res = -EFAULT; | 118 | res = -EFAULT; |
119 | goto out_unlock; | 119 | goto out_unlock; |
120 | } | 120 | } |
121 | priv->adapter->sp.sp_error = p1; | 121 | priv->sp.sp_error = p1; |
122 | priv->adapter->sp.sp_offset = p2; | 122 | priv->sp.sp_offset = p2; |
123 | priv->adapter->sp.sp_stabletime = p3; | 123 | priv->sp.sp_stabletime = p3; |
124 | priv->adapter->sp.sp_calcontrol = p4; | 124 | priv->sp.sp_calcontrol = p4; |
125 | priv->adapter->sp.sp_extsleepclk = p5; | 125 | priv->sp.sp_extsleepclk = p5; |
126 | priv->adapter->sp.sp_reserved = p6; | 126 | priv->sp.sp_reserved = p6; |
127 | 127 | ||
128 | res = lbs_prepare_and_send_command(priv, | 128 | res = lbs_prepare_and_send_command(priv, |
129 | CMD_802_11_SLEEP_PARAMS, | 129 | CMD_802_11_SLEEP_PARAMS, |
@@ -144,7 +144,6 @@ static ssize_t lbs_sleepparams_read(struct file *file, char __user *userbuf, | |||
144 | size_t count, loff_t *ppos) | 144 | size_t count, loff_t *ppos) |
145 | { | 145 | { |
146 | struct lbs_private *priv = file->private_data; | 146 | struct lbs_private *priv = file->private_data; |
147 | struct lbs_adapter *adapter = priv->adapter; | ||
148 | ssize_t res; | 147 | ssize_t res; |
149 | size_t pos = 0; | 148 | size_t pos = 0; |
150 | unsigned long addr = get_zeroed_page(GFP_KERNEL); | 149 | unsigned long addr = get_zeroed_page(GFP_KERNEL); |
@@ -159,10 +158,10 @@ static ssize_t lbs_sleepparams_read(struct file *file, char __user *userbuf, | |||
159 | goto out_unlock; | 158 | goto out_unlock; |
160 | } | 159 | } |
161 | 160 | ||
162 | pos += snprintf(buf, len, "%d %d %d %d %d %d\n", adapter->sp.sp_error, | 161 | pos += snprintf(buf, len, "%d %d %d %d %d %d\n", priv->sp.sp_error, |
163 | adapter->sp.sp_offset, adapter->sp.sp_stabletime, | 162 | priv->sp.sp_offset, priv->sp.sp_stabletime, |
164 | adapter->sp.sp_calcontrol, adapter->sp.sp_extsleepclk, | 163 | priv->sp.sp_calcontrol, priv->sp.sp_extsleepclk, |
165 | adapter->sp.sp_reserved); | 164 | priv->sp.sp_reserved); |
166 | 165 | ||
167 | res = simple_read_from_buffer(userbuf, count, ppos, buf, pos); | 166 | res = simple_read_from_buffer(userbuf, count, ppos, buf, pos); |
168 | 167 | ||
@@ -321,11 +320,11 @@ static ssize_t lbs_setuserscan(struct file *file, | |||
321 | lbs_parse_type(buf, count, scan_cfg); | 320 | lbs_parse_type(buf, count, scan_cfg); |
322 | 321 | ||
323 | lbs_scan_networks(priv, scan_cfg, 1); | 322 | lbs_scan_networks(priv, scan_cfg, 1); |
324 | wait_event_interruptible(priv->adapter->cmd_pending, | 323 | wait_event_interruptible(priv->cmd_pending, |
325 | priv->adapter->surpriseremoved || | 324 | priv->surpriseremoved || |
326 | (!priv->adapter->cur_cmd && list_empty(&priv->adapter->cmdpendingq))); | 325 | (!priv->cur_cmd && list_empty(&priv->cmdpendingq))); |
327 | 326 | ||
328 | if (priv->adapter->surpriseremoved) | 327 | if (priv->surpriseremoved) |
329 | goto out_scan_cfg; | 328 | goto out_scan_cfg; |
330 | 329 | ||
331 | memset(&wrqu, 0x00, sizeof(union iwreq_data)); | 330 | memset(&wrqu, 0x00, sizeof(union iwreq_data)); |
@@ -620,7 +619,6 @@ static ssize_t lbs_rdmac_read(struct file *file, char __user *userbuf, | |||
620 | size_t count, loff_t *ppos) | 619 | size_t count, loff_t *ppos) |
621 | { | 620 | { |
622 | struct lbs_private *priv = file->private_data; | 621 | struct lbs_private *priv = file->private_data; |
623 | struct lbs_adapter *adapter = priv->adapter; | ||
624 | struct lbs_offset_value offval; | 622 | struct lbs_offset_value offval; |
625 | ssize_t pos = 0; | 623 | ssize_t pos = 0; |
626 | int ret; | 624 | int ret; |
@@ -635,7 +633,7 @@ static ssize_t lbs_rdmac_read(struct file *file, char __user *userbuf, | |||
635 | CMD_OPTION_WAITFORRSP, 0, &offval); | 633 | CMD_OPTION_WAITFORRSP, 0, &offval); |
636 | mdelay(10); | 634 | mdelay(10); |
637 | pos += snprintf(buf+pos, len-pos, "MAC[0x%x] = 0x%08x\n", | 635 | pos += snprintf(buf+pos, len-pos, "MAC[0x%x] = 0x%08x\n", |
638 | priv->mac_offset, adapter->offsetvalue.value); | 636 | priv->mac_offset, priv->offsetvalue.value); |
639 | 637 | ||
640 | ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); | 638 | ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); |
641 | free_page(addr); | 639 | free_page(addr); |
@@ -703,7 +701,6 @@ static ssize_t lbs_rdbbp_read(struct file *file, char __user *userbuf, | |||
703 | size_t count, loff_t *ppos) | 701 | size_t count, loff_t *ppos) |
704 | { | 702 | { |
705 | struct lbs_private *priv = file->private_data; | 703 | struct lbs_private *priv = file->private_data; |
706 | struct lbs_adapter *adapter = priv->adapter; | ||
707 | struct lbs_offset_value offval; | 704 | struct lbs_offset_value offval; |
708 | ssize_t pos = 0; | 705 | ssize_t pos = 0; |
709 | int ret; | 706 | int ret; |
@@ -718,7 +715,7 @@ static ssize_t lbs_rdbbp_read(struct file *file, char __user *userbuf, | |||
718 | CMD_OPTION_WAITFORRSP, 0, &offval); | 715 | CMD_OPTION_WAITFORRSP, 0, &offval); |
719 | mdelay(10); | 716 | mdelay(10); |
720 | pos += snprintf(buf+pos, len-pos, "BBP[0x%x] = 0x%08x\n", | 717 | pos += snprintf(buf+pos, len-pos, "BBP[0x%x] = 0x%08x\n", |
721 | priv->bbp_offset, adapter->offsetvalue.value); | 718 | priv->bbp_offset, priv->offsetvalue.value); |
722 | 719 | ||
723 | ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); | 720 | ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); |
724 | free_page(addr); | 721 | free_page(addr); |
@@ -787,7 +784,6 @@ static ssize_t lbs_rdrf_read(struct file *file, char __user *userbuf, | |||
787 | size_t count, loff_t *ppos) | 784 | size_t count, loff_t *ppos) |
788 | { | 785 | { |
789 | struct lbs_private *priv = file->private_data; | 786 | struct lbs_private *priv = file->private_data; |
790 | struct lbs_adapter *adapter = priv->adapter; | ||
791 | struct lbs_offset_value offval; | 787 | struct lbs_offset_value offval; |
792 | ssize_t pos = 0; | 788 | ssize_t pos = 0; |
793 | int ret; | 789 | int ret; |
@@ -802,7 +798,7 @@ static ssize_t lbs_rdrf_read(struct file *file, char __user *userbuf, | |||
802 | CMD_OPTION_WAITFORRSP, 0, &offval); | 798 | CMD_OPTION_WAITFORRSP, 0, &offval); |
803 | mdelay(10); | 799 | mdelay(10); |
804 | pos += snprintf(buf+pos, len-pos, "RF[0x%x] = 0x%08x\n", | 800 | pos += snprintf(buf+pos, len-pos, "RF[0x%x] = 0x%08x\n", |
805 | priv->rf_offset, adapter->offsetvalue.value); | 801 | priv->rf_offset, priv->offsetvalue.value); |
806 | 802 | ||
807 | ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); | 803 | ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); |
808 | free_page(addr); | 804 | free_page(addr); |
@@ -1009,8 +1005,8 @@ void lbs_debugfs_remove_one(struct lbs_private *priv) | |||
1009 | 1005 | ||
1010 | #ifdef PROC_DEBUG | 1006 | #ifdef PROC_DEBUG |
1011 | 1007 | ||
1012 | #define item_size(n) (FIELD_SIZEOF(struct lbs_adapter, n)) | 1008 | #define item_size(n) (FIELD_SIZEOF(struct lbs_private, n)) |
1013 | #define item_addr(n) (offsetof(struct lbs_adapter, n)) | 1009 | #define item_addr(n) (offsetof(struct lbs_private, n)) |
1014 | 1010 | ||
1015 | 1011 | ||
1016 | struct debug_data { | 1012 | struct debug_data { |
@@ -1019,7 +1015,7 @@ struct debug_data { | |||
1019 | size_t addr; | 1015 | size_t addr; |
1020 | }; | 1016 | }; |
1021 | 1017 | ||
1022 | /* To debug any member of struct lbs_adapter, simply add one line here. | 1018 | /* To debug any member of struct lbs_private, simply add one line here. |
1023 | */ | 1019 | */ |
1024 | static struct debug_data items[] = { | 1020 | static struct debug_data items[] = { |
1025 | {"intcounter", item_size(intcounter), item_addr(intcounter)}, | 1021 | {"intcounter", item_size(intcounter), item_addr(intcounter)}, |
@@ -1158,7 +1154,7 @@ static void lbs_debug_init(struct lbs_private *priv, struct net_device *dev) | |||
1158 | return; | 1154 | return; |
1159 | 1155 | ||
1160 | for (i = 0; i < num_of_items; i++) | 1156 | for (i = 0; i < num_of_items; i++) |
1161 | items[i].addr += (size_t) priv->adapter; | 1157 | items[i].addr += (size_t) priv; |
1162 | 1158 | ||
1163 | priv->debugfs_debug = debugfs_create_file("debug", 0644, | 1159 | priv->debugfs_debug = debugfs_create_file("debug", 0644, |
1164 | priv->debugfs_dir, &items[0], | 1160 | priv->debugfs_dir, &items[0], |