Commit 4c3ca4da authored by Jan-Bernd Themann's avatar Jan-Bernd Themann Committed by Jeff Garzik

eHEA: Capability flag for DLPAR support

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: default avatarJan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent e1abecc4
...@@ -39,7 +39,13 @@ ...@@ -39,7 +39,13 @@
#include <asm/io.h> #include <asm/io.h>
#define DRV_NAME "ehea" #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 \ #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
| NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR) | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
......
...@@ -2923,6 +2923,15 @@ static int check_module_parm(void) ...@@ -2923,6 +2923,15 @@ static int check_module_parm(void)
return ret; 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 __init ehea_module_init(void)
{ {
int ret; int ret;
...@@ -2934,8 +2943,19 @@ int __init ehea_module_init(void) ...@@ -2934,8 +2943,19 @@ int __init ehea_module_init(void)
if (ret) if (ret)
goto out; goto out;
ret = ibmebus_register_driver(&ehea_driver); ret = ibmebus_register_driver(&ehea_driver);
if (ret) if (ret) {
ehea_error("failed registering eHEA device driver on ebus"); 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: out:
return ret; return ret;
...@@ -2943,6 +2963,7 @@ int __init ehea_module_init(void) ...@@ -2943,6 +2963,7 @@ int __init ehea_module_init(void)
static void __exit ehea_module_exit(void) static void __exit ehea_module_exit(void)
{ {
driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities);
ibmebus_unregister_driver(&ehea_driver); ibmebus_unregister_driver(&ehea_driver);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment