Skip to content

Commit 4c3ca4d

Browse files
Jan-Bernd ThemannJeff Garzik
authored andcommitted
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: Jan-Bernd Themann <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
1 parent e1abecc commit 4c3ca4d

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

drivers/net/ehea/ehea.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,13 @@
3939
#include <asm/io.h>
4040

4141
#define DRV_NAME "ehea"
42-
#define DRV_VERSION "EHEA_0065"
42+
#define DRV_VERSION "EHEA_0067"
43+
44+
/* EHEA capability flags */
45+
#define DLPAR_PORT_ADD_REM 1
46+
#define DLPAR_MEM_ADD 2
47+
#define DLPAR_MEM_REM 4
48+
#define EHEA_CAPABILITIES (DLPAR_PORT_ADD_REM)
4349

4450
#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
4551
| NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)

drivers/net/ehea/ehea_main.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2923,6 +2923,15 @@ static int check_module_parm(void)
29232923
return ret;
29242924
}
29252925

2926+
static ssize_t ehea_show_capabilities(struct device_driver *drv,
2927+
char *buf)
2928+
{
2929+
return sprintf(buf, "%d", EHEA_CAPABILITIES);
2930+
}
2931+
2932+
static DRIVER_ATTR(capabilities, S_IRUSR | S_IRGRP | S_IROTH,
2933+
ehea_show_capabilities, NULL);
2934+
29262935
int __init ehea_module_init(void)
29272936
{
29282937
int ret;
@@ -2934,15 +2943,27 @@ int __init ehea_module_init(void)
29342943
if (ret)
29352944
goto out;
29362945
ret = ibmebus_register_driver(&ehea_driver);
2937-
if (ret)
2946+
if (ret) {
29382947
ehea_error("failed registering eHEA device driver on ebus");
2948+
goto out;
2949+
}
2950+
2951+
ret = driver_create_file(&ehea_driver.driver,
2952+
&driver_attr_capabilities);
2953+
if (ret) {
2954+
ehea_error("failed to register capabilities attribute, ret=%d",
2955+
ret);
2956+
ibmebus_unregister_driver(&ehea_driver);
2957+
goto out;
2958+
}
29392959

29402960
out:
29412961
return ret;
29422962
}
29432963

29442964
static void __exit ehea_module_exit(void)
29452965
{
2966+
driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities);
29462967
ibmebus_unregister_driver(&ehea_driver);
29472968
}
29482969

0 commit comments

Comments
 (0)