Re: [PATCH 1/4] staging: rtl8188eu: os_intfs.c

2014-08-30 Thread Greg KH
Your subject does not say what is going on in this patch, only the file
being modified :(


On Fri, Aug 22, 2014 at 11:32:38AM +0100, Miguel Oliveira wrote:
> void rtw_proc_remove_one(struct net_device *dev)
> {
> }
> void rtw_proc_init_one(struct net_device *dev)
>   /* TODO: Convert these to /sys */
> 
> Converting the above from proc into debugfs.
> Convert all rtw_proc_xxx references to rtw_sys_xxx

I don't understand, what exactly are you doing here?

Are you moving stuff to debugfs or to sysfs?  And what exactly are you
moving?  And why?  And if sysfs, you need to document the files.

> 
> Signed-off-by: Miguel Oliveira 
> ---
>  drivers/staging/rtl8188eu/os_dep/os_intfs.c |  517 
> +--
>  1 file changed, 326 insertions(+), 191 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c 
> b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
> index c7a44ab..49b441a 100644
> --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
> +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
> @@ -29,6 +29,8 @@
>  
>  #include 
>  
> +#include 
> +
>  MODULE_LICENSE("GPL");
>  MODULE_DESCRIPTION("Realtek Wireless Lan Driver");
>  MODULE_AUTHOR("Realtek Semiconductor Corp.");
> @@ -166,50 +168,254 @@ MODULE_PARM_DESC(rtw_notch_filter, "0:Disable, 
> 1:Enable, 2:Enable only for P2P")
>  module_param_named(debug, rtw_debug, int, 0444);
>  MODULE_PARM_DESC(debug, "Set debug level (1-9) (default 1)");
>  
> -/* dummy routines */
> -void rtw_proc_remove_one(struct net_device *dev)
> -{
> -}
> +static const struct file_operations drv_version = {
> + .owner =THIS_MODULE,
> + .read = sys_get_drv_version,
> + .llseek =   default_llseek,
> +};



You do know that debugfs can handle single variables very easily, with
no need for a file_operations structure, right?  Are you sure you need
all of these new structures?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/4] staging: rtl8188eu: os_intfs.c

2014-08-30 Thread Greg KH
Your subject does not say what is going on in this patch, only the file
being modified :(


On Fri, Aug 22, 2014 at 11:32:38AM +0100, Miguel Oliveira wrote:
 void rtw_proc_remove_one(struct net_device *dev)
 {
 }
 void rtw_proc_init_one(struct net_device *dev)
   /* TODO: Convert these to /sys */
 
 Converting the above from proc into debugfs.
 Convert all rtw_proc_xxx references to rtw_sys_xxx

I don't understand, what exactly are you doing here?

Are you moving stuff to debugfs or to sysfs?  And what exactly are you
moving?  And why?  And if sysfs, you need to document the files.

 
 Signed-off-by: Miguel Oliveira cmro...@gmail.com
 ---
  drivers/staging/rtl8188eu/os_dep/os_intfs.c |  517 
 +--
  1 file changed, 326 insertions(+), 191 deletions(-)
 
 diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c 
 b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
 index c7a44ab..49b441a 100644
 --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
 +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
 @@ -29,6 +29,8 @@
  
  #include usb_hal.h
  
 +#include linux/debugfs.h
 +
  MODULE_LICENSE(GPL);
  MODULE_DESCRIPTION(Realtek Wireless Lan Driver);
  MODULE_AUTHOR(Realtek Semiconductor Corp.);
 @@ -166,50 +168,254 @@ MODULE_PARM_DESC(rtw_notch_filter, 0:Disable, 
 1:Enable, 2:Enable only for P2P)
  module_param_named(debug, rtw_debug, int, 0444);
  MODULE_PARM_DESC(debug, Set debug level (1-9) (default 1));
  
 -/* dummy routines */
 -void rtw_proc_remove_one(struct net_device *dev)
 -{
 -}
 +static const struct file_operations drv_version = {
 + .owner =THIS_MODULE,
 + .read = sys_get_drv_version,
 + .llseek =   default_llseek,
 +};

snip

You do know that debugfs can handle single variables very easily, with
no need for a file_operations structure, right?  Are you sure you need
all of these new structures?

thanks,

greg k-h
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/4] staging: rtl8188eu: os_intfs.c

2014-08-22 Thread Miguel Oliveira
void rtw_proc_remove_one(struct net_device *dev)
{
}
void rtw_proc_init_one(struct net_device *dev)
  /* TODO: Convert these to /sys */

Converting the above from proc into debugfs.
Convert all rtw_proc_xxx references to rtw_sys_xxx

Signed-off-by: Miguel Oliveira 
---
 drivers/staging/rtl8188eu/os_dep/os_intfs.c |  517 +--
 1 file changed, 326 insertions(+), 191 deletions(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c 
b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index c7a44ab..49b441a 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -29,6 +29,8 @@
 
 #include 
 
+#include 
+
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Realtek Wireless Lan Driver");
 MODULE_AUTHOR("Realtek Semiconductor Corp.");
@@ -166,50 +168,254 @@ MODULE_PARM_DESC(rtw_notch_filter, "0:Disable, 1:Enable, 
2:Enable only for P2P")
 module_param_named(debug, rtw_debug, int, 0444);
 MODULE_PARM_DESC(debug, "Set debug level (1-9) (default 1)");
 
-/* dummy routines */
-void rtw_proc_remove_one(struct net_device *dev)
-{
-}
+static const struct file_operations drv_version = {
+   .owner =THIS_MODULE,
+   .read = sys_get_drv_version,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations write_reg = {
+   .owner =THIS_MODULE,
+   .write =sys_set_write_reg,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations read_reg = {
+   .owner =THIS_MODULE,
+   .read = sys_get_read_reg,
+   .write =sys_set_read_reg,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations fwstate = {
+   .owner =THIS_MODULE,
+   .read = sys_get_fwstate,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations sec_info = {
+   .owner =THIS_MODULE,
+   .read = sys_get_sec_info,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations mlmext_state = {
+   .owner =THIS_MODULE,
+   .read = sys_get_mlmext_state,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations qos_option = {
+   .owner =THIS_MODULE,
+   .read = sys_get_qos_option,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations ht_option = {
+   .owner =THIS_MODULE,
+   .read = sys_get_ht_option,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations rf_info = {
+   .owner =THIS_MODULE,
+   .read = sys_get_rf_info,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations ap_info = {
+   .owner =THIS_MODULE,
+   .read = sys_get_ap_info,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations adapter_state = {
+   .owner =THIS_MODULE,
+   .read = sys_get_adapter_state,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations trx_info = {
+   .owner =THIS_MODULE,
+   .read = sys_get_trx_info,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations mac_reg_dump1 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_mac_reg_dump1,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations mac_reg_dump2 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_mac_reg_dump2,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations mac_reg_dump3 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_mac_reg_dump3,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations bb_reg_dump1 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_bb_reg_dump1,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations bb_reg_dump2 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_bb_reg_dump2,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations bb_reg_dump3 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_bb_reg_dump3,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations rf_reg_dump1 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_rf_reg_dump1,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations rf_reg_dump2 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_rf_reg_dump2,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations rf_reg_dump3 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_rf_reg_dump3,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations rf_reg_dump4 = {
+   .owner =   

[PATCH 1/4] staging: rtl8188eu: os_intfs.c

2014-08-22 Thread Miguel Oliveira
void rtw_proc_remove_one(struct net_device *dev)
{
}
void rtw_proc_init_one(struct net_device *dev)
  /* TODO: Convert these to /sys */

Converting the above from proc into debugfs.
Convert all rtw_proc_xxx references to rtw_sys_xxx

Signed-off-by: Miguel Oliveira cmro...@gmail.com
---
 drivers/staging/rtl8188eu/os_dep/os_intfs.c |  517 +--
 1 file changed, 326 insertions(+), 191 deletions(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c 
b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index c7a44ab..49b441a 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -29,6 +29,8 @@
 
 #include usb_hal.h
 
+#include linux/debugfs.h
+
 MODULE_LICENSE(GPL);
 MODULE_DESCRIPTION(Realtek Wireless Lan Driver);
 MODULE_AUTHOR(Realtek Semiconductor Corp.);
@@ -166,50 +168,254 @@ MODULE_PARM_DESC(rtw_notch_filter, 0:Disable, 1:Enable, 
2:Enable only for P2P)
 module_param_named(debug, rtw_debug, int, 0444);
 MODULE_PARM_DESC(debug, Set debug level (1-9) (default 1));
 
-/* dummy routines */
-void rtw_proc_remove_one(struct net_device *dev)
-{
-}
+static const struct file_operations drv_version = {
+   .owner =THIS_MODULE,
+   .read = sys_get_drv_version,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations write_reg = {
+   .owner =THIS_MODULE,
+   .write =sys_set_write_reg,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations read_reg = {
+   .owner =THIS_MODULE,
+   .read = sys_get_read_reg,
+   .write =sys_set_read_reg,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations fwstate = {
+   .owner =THIS_MODULE,
+   .read = sys_get_fwstate,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations sec_info = {
+   .owner =THIS_MODULE,
+   .read = sys_get_sec_info,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations mlmext_state = {
+   .owner =THIS_MODULE,
+   .read = sys_get_mlmext_state,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations qos_option = {
+   .owner =THIS_MODULE,
+   .read = sys_get_qos_option,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations ht_option = {
+   .owner =THIS_MODULE,
+   .read = sys_get_ht_option,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations rf_info = {
+   .owner =THIS_MODULE,
+   .read = sys_get_rf_info,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations ap_info = {
+   .owner =THIS_MODULE,
+   .read = sys_get_ap_info,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations adapter_state = {
+   .owner =THIS_MODULE,
+   .read = sys_get_adapter_state,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations trx_info = {
+   .owner =THIS_MODULE,
+   .read = sys_get_trx_info,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations mac_reg_dump1 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_mac_reg_dump1,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations mac_reg_dump2 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_mac_reg_dump2,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations mac_reg_dump3 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_mac_reg_dump3,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations bb_reg_dump1 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_bb_reg_dump1,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations bb_reg_dump2 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_bb_reg_dump2,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations bb_reg_dump3 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_bb_reg_dump3,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations rf_reg_dump1 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_rf_reg_dump1,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations rf_reg_dump2 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_rf_reg_dump2,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations rf_reg_dump3 = {
+   .owner =THIS_MODULE,
+   .read = sys_get_rf_reg_dump3,
+   .llseek =   default_llseek,
+};
+
+static const struct file_operations