linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] eHEA: Capability flag for DLPAR support
@ 2007-07-04 10:09 Jan-Bernd Themann
  2007-07-04 12:53 ` Akinobu Mita
  0 siblings, 1 reply; 5+ messages in thread
From: Jan-Bernd Themann @ 2007-07-04 10:09 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: Thomas Klein, Jan-Bernd Themann, netdev, linux-kernel, linux-ppc,
	Christoph Raisch, Marcus Eder, Stefan Roscher

This patch introduces a capability flag that is used by the DLPAR userspace
tool to check which DLPAR features are supported by the eHEA driver.

Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>


---
 drivers/net/ehea/ehea.h      |    8 +++++++-
 drivers/net/ehea/ehea_main.c |   17 +++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index abaf3ac..809e3f2 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -39,7 +39,13 @@
 #include <asm/io.h>
 
 #define DRV_NAME	"ehea"
-#define DRV_VERSION	"EHEA_0065"
+#define DRV_VERSION	"EHEA_0066"
+
+/* EHEA capability flags */
+#define DLPAR_PORT_ADD_REM 1
+#define DLPAR_MEM_ADD 2
+#define DLPAR_MEM_REM 4
+#define EHEA_CAPABILITIES (DLPAR_PORT_ADD_REM)
 
 #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
 	| NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index bdb5241..f8c0908 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -2923,6 +2923,15 @@ static int check_module_parm(void)
 	return ret;
 }
 
+static ssize_t ehea_show_capabilities(struct device_driver *drv,
+				      char *buf)
+{
+	return sprintf(buf, "%d", EHEA_CAPABILITIES);
+}
+
+static DRIVER_ATTR(capabilities, S_IRUSR | S_IRGRP | S_IROTH,
+		   ehea_show_capabilities, NULL);
+
 int __init ehea_module_init(void)
 {
 	int ret;
@@ -2937,12 +2946,20 @@ int __init ehea_module_init(void)
 	if (ret)
 		ehea_error("failed registering eHEA device driver on ebus");
 
+	ret = driver_create_file(&ehea_driver.driver, &driver_attr_capabilities);
+	if (ret) {
+		ehea_error("failed to register capabilities attribute, ret=%d", ret);
+		ibmebus_unregister_driver(&ehea_driver);
+		goto out;
+	}
+
 out:
 	return ret;
 }
 
 static void __exit ehea_module_exit(void)
 {
+	driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities);
 	ibmebus_unregister_driver(&ehea_driver);
 }
 
-- 
1.5.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] eHEA: Capability flag for DLPAR support
  2007-07-04 10:09 [PATCH 1/2] eHEA: Capability flag for DLPAR support Jan-Bernd Themann
@ 2007-07-04 12:53 ` Akinobu Mita
  2007-07-04 12:58   ` Jan-Bernd Themann
  0 siblings, 1 reply; 5+ messages in thread
From: Akinobu Mita @ 2007-07-04 12:53 UTC (permalink / raw)
  To: Jan-Bernd Themann
  Cc: Thomas Klein, Jeff Garzik, Jan-Bernd Themann, netdev,
	linux-kernel, linux-ppc, Christoph Raisch, Marcus Eder,
	Stefan Roscher

2007/7/4, Jan-Bernd Themann <ossthema@de.ibm.com>:

> diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
> index bdb5241..f8c0908 100644
> --- a/drivers/net/ehea/ehea_main.c
> +++ b/drivers/net/ehea/ehea_main.c
> @@ -2923,6 +2923,15 @@ static int check_module_parm(void)
>         return ret;
>  }
>
> +static ssize_t ehea_show_capabilities(struct device_driver *drv,
> +                                     char *buf)
> +{
> +       return sprintf(buf, "%d", EHEA_CAPABILITIES);
> +}
> +
> +static DRIVER_ATTR(capabilities, S_IRUSR | S_IRGRP | S_IROTH,
> +                  ehea_show_capabilities, NULL);
> +
>  int __init ehea_module_init(void)
>  {
>         int ret;
> @@ -2937,12 +2946,20 @@ int __init ehea_module_init(void)
>         if (ret)
>                 ehea_error("failed registering eHEA device driver on ebus");
>

You forgot to put:
                return ret;
or
                goto out;

> +       ret = driver_create_file(&ehea_driver.driver, &driver_attr_capabilities);
> +       if (ret) {
> +               ehea_error("failed to register capabilities attribute, ret=%d", ret);
> +               ibmebus_unregister_driver(&ehea_driver);
> +               goto out;
> +       }
> +
>  out:
>         return ret;
>  }
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] eHEA: Capability flag for DLPAR support
  2007-07-04 12:53 ` Akinobu Mita
@ 2007-07-04 12:58   ` Jan-Bernd Themann
  0 siblings, 0 replies; 5+ messages in thread
From: Jan-Bernd Themann @ 2007-07-04 12:58 UTC (permalink / raw)
  To: Akinobu Mita
  Cc: Thomas Klein, Jeff Garzik, Jan-Bernd Themann, netdev,
	linux-kernel, linux-ppc, Christoph Raisch, Marcus Eder,
	Stefan Roscher

Hi,

good catch.

Thanks

On Wednesday 04 July 2007 14:53, Akinobu Mita wrote:
> 2007/7/4, Jan-Bernd Themann <ossthema@de.ibm.com>:
> 
> > diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
> > index bdb5241..f8c0908 100644
> > --- a/drivers/net/ehea/ehea_main.c
> > +++ b/drivers/net/ehea/ehea_main.c
> > @@ -2923,6 +2923,15 @@ static int check_module_parm(void)
> >         return ret;
> >  }
> >
> > +static ssize_t ehea_show_capabilities(struct device_driver *drv,
> > +                                     char *buf)
> > +{
> > +       return sprintf(buf, "%d", EHEA_CAPABILITIES);
> > +}
> > +
> > +static DRIVER_ATTR(capabilities, S_IRUSR | S_IRGRP | S_IROTH,
> > +                  ehea_show_capabilities, NULL);
> > +
> >  int __init ehea_module_init(void)
> >  {
> >         int ret;
> > @@ -2937,12 +2946,20 @@ int __init ehea_module_init(void)
> >         if (ret)
> >                 ehea_error("failed registering eHEA device driver on ebus");
> >
> 
> You forgot to put:
>                 return ret;
> or
>                 goto out;
> 
> > +       ret = driver_create_file(&ehea_driver.driver, &driver_attr_capabilities);
> > +       if (ret) {
> > +               ehea_error("failed to register capabilities attribute, ret=%d", ret);
> > +               ibmebus_unregister_driver(&ehea_driver);
> > +               goto out;
> > +       }
> > +
> >  out:
> >         return ret;
> >  }
> >
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] eHEA: Capability flag for DLPAR support
@ 2007-07-05  7:26 Jan-Bernd Themann
  2007-07-10 16:59 ` Jeff Garzik
  0 siblings, 1 reply; 5+ messages in thread
From: Jan-Bernd Themann @ 2007-07-05  7:26 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: Thomas Klein, Jan-Bernd Themann, netdev, linux-kernel, linux-ppc,
	Christoph Raisch, Marcus Eder, Stefan Roscher

This patch introduces a capability flag that is used by the DLPAR userspace
tool to check which DLPAR features are supported by the eHEA driver.

Missing goto has been included.

Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
---
 drivers/net/ehea/ehea.h      |    8 +++++++-
 drivers/net/ehea/ehea_main.c |   23 ++++++++++++++++++++++-
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index abaf3ac..f03f070 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -39,7 +39,13 @@
 #include <asm/io.h>
 
 #define DRV_NAME	"ehea"
-#define DRV_VERSION	"EHEA_0065"
+#define DRV_VERSION	"EHEA_0067"
+
+/* EHEA capability flags */
+#define DLPAR_PORT_ADD_REM 1
+#define DLPAR_MEM_ADD 2
+#define DLPAR_MEM_REM 4
+#define EHEA_CAPABILITIES (DLPAR_PORT_ADD_REM)
 
 #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
 	| NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index bdb5241..383144d 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -2923,6 +2923,15 @@ static int check_module_parm(void)
 	return ret;
 }
 
+static ssize_t ehea_show_capabilities(struct device_driver *drv,
+				      char *buf)
+{
+	return sprintf(buf, "%d", EHEA_CAPABILITIES);
+}
+
+static DRIVER_ATTR(capabilities, S_IRUSR | S_IRGRP | S_IROTH,
+		   ehea_show_capabilities, NULL);
+
 int __init ehea_module_init(void)
 {
 	int ret;
@@ -2934,8 +2943,19 @@ int __init ehea_module_init(void)
 	if (ret)
 		goto out;
 	ret = ibmebus_register_driver(&ehea_driver);
-	if (ret)
+	if (ret) {
 		ehea_error("failed registering eHEA device driver on ebus");
+		goto out;
+	}
+
+	ret = driver_create_file(&ehea_driver.driver,
+				 &driver_attr_capabilities);
+	if (ret) {
+		ehea_error("failed to register capabilities attribute, ret=%d",
+			   ret);
+		ibmebus_unregister_driver(&ehea_driver);
+		goto out;
+	}
 
 out:
 	return ret;
@@ -2943,6 +2963,7 @@ out:
 
 static void __exit ehea_module_exit(void)
 {
+	driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities);
 	ibmebus_unregister_driver(&ehea_driver);
 }
 
-- 
1.5.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] eHEA: Capability flag for DLPAR support
  2007-07-05  7:26 Jan-Bernd Themann
@ 2007-07-10 16:59 ` Jeff Garzik
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff Garzik @ 2007-07-10 16:59 UTC (permalink / raw)
  To: Jan-Bernd Themann
  Cc: Thomas Klein, Jan-Bernd Themann, netdev, linux-kernel, linux-ppc,
	Christoph Raisch, Marcus Eder, Stefan Roscher

Jan-Bernd Themann wrote:
> This patch introduces a capability flag that is used by the DLPAR userspace
> tool to check which DLPAR features are supported by the eHEA driver.
> 
> Missing goto has been included.
> 
> Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>

applied

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-07-10 16:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-04 10:09 [PATCH 1/2] eHEA: Capability flag for DLPAR support Jan-Bernd Themann
2007-07-04 12:53 ` Akinobu Mita
2007-07-04 12:58   ` Jan-Bernd Themann
  -- strict thread matches above, loose matches on Subject: below --
2007-07-05  7:26 Jan-Bernd Themann
2007-07-10 16:59 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).