Commit 1e92a8df authored by Arun Gopalakrishnan's avatar Arun Gopalakrishnan Committed by Hari Kanigeri

ARM OMAP4 Syslink IPC NameServer,NameServer Notify Changes

This patch can be used to synk with the syslink drop 2.0.0.6
for above modules
The major changes are
1. The atomic function usage came in the above modules
2. Some logical changes came in some of the fuinctions
   in above modules (nameserver get, nameserver notify get etc.)
Signed-off-by: default avatarArun M G <arunmg@ti.com>
parent 33a77e11
...@@ -23,6 +23,12 @@ ...@@ -23,6 +23,12 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/list.h> #include <linux/list.h>
/*
* NAMESERVER_MODULEID
* Unique module ID
*/
#define NAMESERVER_MODULEID (0xF414)
/* /*
* Instance config-params object. * Instance config-params object.
*/ */
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
struct nameserver_remote_object { struct nameserver_remote_object {
int (*get)(const struct nameserver_remote_object *obj, int (*get)(const struct nameserver_remote_object *obj,
const char *instance_name, const char *name, const char *instance_name, const char *name,
void *value, u32 value_len); /* Function to get data from void *value, u32 value_len, void *reserved);
remote nameserver */ /* Function to get data from remote nameserver */
void *obj; /* Implementation specific object */ void *obj; /* Implementation specific object */
}; };
......
...@@ -21,13 +21,18 @@ ...@@ -21,13 +21,18 @@
#include <linux/types.h> #include <linux/types.h>
/*
* NAMESERVERREMOTENOTIFY_MODULEID
* Unique module ID
*/
#define NAMESERVERREMOTENOTIFY_MODULEID (0x08FD)
/* /*
* Module configuration structure * Module configuration structure
*/ */
struct nameserver_remotenotify_config { struct nameserver_remotenotify_config {
void *gate_handle; u32 reserved;
/* Handle of gate to be used for local thread safety. /* Reserved value (not currently used) */
If provided as NULL, gate handle is created internally. */
}; };
/* /*
...@@ -82,7 +87,7 @@ int nameserver_remotenotify_delete(void **handle); ...@@ -82,7 +87,7 @@ int nameserver_remotenotify_delete(void **handle);
*/ */
int nameserver_remotenotify_get(void *handle, int nameserver_remotenotify_get(void *handle,
const char *instance_name, const char *name, const char *instance_name, const char *name,
u8 *value, u32 value_len, void *reserved); void *value, u32 value_len, void *reserved);
/* /*
* Get the shared memory requirements for the nameserver_remotenotify * Get the shared memory requirements for the nameserver_remotenotify
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <syslink/atomic_linux.h>
#include <nameserver.h> #include <nameserver.h>
#include <multiproc.h> #include <multiproc.h>
...@@ -103,6 +104,9 @@ ...@@ -103,6 +104,9 @@
* *
*/ */
/* Macro to make a correct module magic number with refCount */
#define NAMESERVER_MAKE_MAGICSTAMP(x) ((NAMESERVER_MODULEID << 12u) | (x))
/* /*
* A name/value table entry * A name/value table entry
*/ */
...@@ -135,6 +139,7 @@ struct nameserver_module_object { ...@@ -135,6 +139,7 @@ struct nameserver_module_object {
struct list_head obj_list; struct list_head obj_list;
struct mutex *list_lock; struct mutex *list_lock;
struct nameserver_remote_object **remote_handle_list; struct nameserver_remote_object **remote_handle_list;
atomic_t ref_count;
}; };
/* /*
...@@ -224,6 +229,19 @@ int nameserver_setup(void) ...@@ -224,6 +229,19 @@ int nameserver_setup(void)
s32 retval = 0; s32 retval = 0;
u16 nr_procs = 0; u16 nr_procs = 0;
/* This sets the ref_count variable if not initialized, upper 16 bits is
* written with module Id to ensure correctness of refCount variable
*/
atomic_cmpmask_and_set(&nameserver_state.ref_count,
NAMESERVER_MAKE_MAGICSTAMP(0),
NAMESERVER_MAKE_MAGICSTAMP(0));
if (atomic_inc_return(&nameserver_state.ref_count)
!= NAMESERVER_MAKE_MAGICSTAMP(1)) {
retval = -EEXIST;
goto error;
}
nr_procs = multiproc_get_max_processors(); nr_procs = multiproc_get_max_processors();
list = kmalloc(nr_procs * sizeof(struct nameserver_remote_object *), list = kmalloc(nr_procs * sizeof(struct nameserver_remote_object *),
GFP_KERNEL); GFP_KERNEL);
...@@ -245,8 +263,8 @@ int nameserver_setup(void) ...@@ -245,8 +263,8 @@ int nameserver_setup(void)
return 0; return 0;
error: error:
printk(KERN_ERR "nameserver_setup failed, retval: %x\n", retval);
kfree(list); kfree(list);
printk(KERN_ERR "nameserver_setup failed, retval: %x\n", retval);
return retval; return retval;
} }
EXPORT_SYMBOL(nameserver_setup); EXPORT_SYMBOL(nameserver_setup);
...@@ -261,6 +279,13 @@ int nameserver_destroy(void) ...@@ -261,6 +279,13 @@ int nameserver_destroy(void)
s32 retval = 0; s32 retval = 0;
struct mutex *lock = NULL; struct mutex *lock = NULL;
if (WARN_ON(atomic_cmpmask_and_lt(&(nameserver_state.ref_count),
NAMESERVER_MAKE_MAGICSTAMP(0),
NAMESERVER_MAKE_MAGICSTAMP(1)) == true)) {
retval = -ENODEV;
goto exit;
}
if (WARN_ON(nameserver_state.list_lock == NULL)) { if (WARN_ON(nameserver_state.list_lock == NULL)) {
retval = -ENODEV; retval = -ENODEV;
goto exit; goto exit;
...@@ -782,8 +807,7 @@ error: ...@@ -782,8 +807,7 @@ error:
mutex_unlock(temp_obj->gate_handle); mutex_unlock(temp_obj->gate_handle);
exit: exit:
printk(KERN_ERR "nameserver_get_local failed status:%x \n", printk(KERN_ERR "nameserver_get_local entry not found!\n");
retval);
return retval; return retval;
} }
EXPORT_SYMBOL(nameserver_get_local); EXPORT_SYMBOL(nameserver_get_local);
...@@ -824,10 +848,12 @@ int nameserver_get(void *handle, const char *name, ...@@ -824,10 +848,12 @@ int nameserver_get(void *handle, const char *name,
/* Skip current processor */ /* Skip current processor */
if (i == local_proc_id) if (i == local_proc_id)
continue; continue;
retval = nameserver_remote_get( retval = nameserver_remote_get(
nameserver_state.remote_handle_list[i], nameserver_state.remote_handle_list[i],
temp_obj->name, name, buffer, length); temp_obj->name, name, buffer, length);
if (retval == 0) /* Got the value */ if (retval > 0 || ((retval < 0) &&
(retval != -ENOENT))) /* Got the value */
break; break;
} }
goto exit; goto exit;
...@@ -848,7 +874,8 @@ int nameserver_get(void *handle, const char *name, ...@@ -848,7 +874,8 @@ int nameserver_get(void *handle, const char *name,
retval = nameserver_remote_get( retval = nameserver_remote_get(
nameserver_state.remote_handle_list[proc_id[i]], nameserver_state.remote_handle_list[proc_id[i]],
temp_obj->name, name, buffer, length); temp_obj->name, name, buffer, length);
if (retval == 0) if (retval > 0 || ((retval < 0) &&
(retval != -ENOENT))) /* Got the value */
break; break;
} }
} }
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <gt.h>
#include <nameserver_remote.h> #include <nameserver_remote.h>
/* /*
...@@ -31,20 +30,13 @@ int nameserver_remote_get(const struct nameserver_remote_object *handle, ...@@ -31,20 +30,13 @@ int nameserver_remote_get(const struct nameserver_remote_object *handle,
{ {
s32 retval = 0; s32 retval = 0;
if (WARN_ON(instance_name == NULL)) {
gt_0trace(ns_debugmask, GT_ENTER, "nameserver_remote_get\n");
if (handle == NULL || instance_name == NULL ||
name == NULL || value == NULL) {
gt_5trace(ns_debugmask, GT_6CLASS,
"nameserver_remote_get: invalid argument!\n"
"instance_name: %s,\n name: %s,\n"
"handle: %x, value: %x, value_len: %x\n",
instance_name, name, handle, value, value_len);
retval = -EINVAL; retval = -EINVAL;
goto exit; goto exit;
} }
retval = handle->get(handle, instance_name, name, value, value_len); retval = handle->get(handle, instance_name,
name, value, value_len, NULL);
exit: exit:
return retval; return retval;
......
...@@ -30,10 +30,6 @@ ...@@ -30,10 +30,6 @@
#include <nameserver_remotenotify.h> #include <nameserver_remotenotify.h>
#include <notify.h> #include <notify.h>
#define NAMESERVER_APPLICATION "Nameserver_Application"
#define NAMESERVER_MODULES "Nameserver_Modules"
/* /*
* Cache line length * Cache line length
* TODO: Short-term hack. Make parameter or figure out some other way! * TODO: Short-term hack. Make parameter or figure out some other way!
...@@ -51,19 +47,6 @@ struct nameserver_remotenotify_module_object { ...@@ -51,19 +47,6 @@ struct nameserver_remotenotify_module_object {
void *gate_handle; void *gate_handle;
}; };
/*
* Namseserver remote transport state object definition
*/
struct nameserver_remotenotify_slave_info {
int *nd_handle; /* List of notify driver handles for each slave */
int *sem_handle; /* Handle to the semaphore */
int *gate_handle; /* Slave transport Gate handle */
char *name; /* Pointer to the name sent from other side */
int *value; /* Pointer to the value sent from other side */
u32 name_len; /* Length of name pointer */
u32 value_len; /* Length of value pointer */
};
/* /*
* NameServer remote transport state attributes * NameServer remote transport state attributes
*/ */
...@@ -73,6 +56,8 @@ struct nameserver_remotenotify_attrs { ...@@ -73,6 +56,8 @@ struct nameserver_remotenotify_attrs {
u32 shared_addr_size; u32 shared_addr_size;
}; };
#define MAX_VALUE_LEN 300 /* This should be actually sync with
nameserver value or user configured value */
/* /*
* NameServer remote transport packet definition * NameServer remote transport packet definition
*/ */
...@@ -84,7 +69,8 @@ struct nameserver_remotenotify_message { ...@@ -84,7 +69,8 @@ struct nameserver_remotenotify_message {
u32 value; u32 value;
u32 value_len; u32 value_len;
char instance_name[32]; char instance_name[32];
char name[72]; char name[32];
char value_buf[MAX_VALUE_LEN];
}; };
/* /*
...@@ -105,7 +91,7 @@ struct nameserver_remotenotify_obj { ...@@ -105,7 +91,7 @@ struct nameserver_remotenotify_obj {
struct nameserver_remotenotify_object { struct nameserver_remotenotify_object {
int (*get)(void *, int (*get)(void *,
const char *instance_name, const char *name, const char *instance_name, const char *name,
u8 *value, u32 value_len, void *reserved); void *value, u32 value_len, void *reserved);
void *obj; /* Implementation specific object */ void *obj; /* Implementation specific object */
}; };
...@@ -116,7 +102,7 @@ static struct nameserver_remotenotify_module_object ...@@ -116,7 +102,7 @@ static struct nameserver_remotenotify_module_object
nameserver_remotenotify_state = { nameserver_remotenotify_state = {
.is_setup = false, .is_setup = false,
.gate_handle = NULL, .gate_handle = NULL,
.def_cfg.gate_handle = NULL, .def_cfg.reserved = 0,
.def_inst_params.gate = NULL, .def_inst_params.gate = NULL,
.def_inst_params.shared_addr = 0x0, .def_inst_params.shared_addr = 0x0,
.def_inst_params.shared_addr_size = 0x0, .def_inst_params.shared_addr_size = 0x0,
...@@ -138,10 +124,7 @@ static struct nameserver_remotenotify_module_object ...@@ -138,10 +124,7 @@ static struct nameserver_remotenotify_module_object
void nameserver_remotenotify_get_config( void nameserver_remotenotify_get_config(
struct nameserver_remotenotify_config *cfg) struct nameserver_remotenotify_config *cfg)
{ {
gt_1trace(nameserver_remotenotify_mask, GT_ENTER,
"nameserver_remotenotify_get_config:\n cfg: %x\n", cfg);
BUG_ON(cfg == NULL); BUG_ON(cfg == NULL);
if (nameserver_remotenotify_state.is_setup == false) if (nameserver_remotenotify_state.is_setup == false)
memcpy(cfg, &(nameserver_remotenotify_state.def_cfg), memcpy(cfg, &(nameserver_remotenotify_state.def_cfg),
sizeof(struct nameserver_remotenotify_config)); sizeof(struct nameserver_remotenotify_config));
...@@ -176,18 +159,13 @@ int nameserver_remotenotify_setup( ...@@ -176,18 +159,13 @@ int nameserver_remotenotify_setup(
struct mutex *lock = NULL; struct mutex *lock = NULL;
bool user_cfg = true; bool user_cfg = true;
gt_1trace(nameserver_remotenotify_mask, GT_ENTER,
"nameserver_remotenotify_setup:\n cfg: %x\n", cfg);
if (cfg == NULL) { if (cfg == NULL) {
nameserver_remotenotify_get_config(&tmp_cfg); nameserver_remotenotify_get_config(&tmp_cfg);
cfg = &tmp_cfg; cfg = &tmp_cfg;
user_cfg = false; user_cfg = false;
} }
if (cfg->gate_handle != NULL) /* Create a default gate handle for local module protection */
nameserver_remotenotify_state.gate_handle = cfg->gate_handle;
else {
lock = kmalloc(sizeof(struct mutex), GFP_KERNEL); lock = kmalloc(sizeof(struct mutex), GFP_KERNEL);
if (lock == NULL) { if (lock == NULL) {
retval = -ENOMEM; retval = -ENOMEM;
...@@ -196,8 +174,6 @@ int nameserver_remotenotify_setup( ...@@ -196,8 +174,6 @@ int nameserver_remotenotify_setup(
mutex_init(lock); mutex_init(lock);
nameserver_remotenotify_state.gate_handle = lock; nameserver_remotenotify_state.gate_handle = lock;
}
if (user_cfg) if (user_cfg)
memcpy(&nameserver_remotenotify_state.cfg, cfg, memcpy(&nameserver_remotenotify_state.cfg, cfg,
sizeof(struct nameserver_remotenotify_config)); sizeof(struct nameserver_remotenotify_config));
...@@ -218,14 +194,9 @@ exit: ...@@ -218,14 +194,9 @@ exit:
*/ */
int nameserver_remotenotify_destroy(void) int nameserver_remotenotify_destroy(void)
{ {
gt_0trace(nameserver_remotenotify_mask, GT_ENTER,
"nameserver_remotenotify_destroy:\n");
/* Check if the gate_handle was created internally. */
if (nameserver_remotenotify_state.cfg.gate_handle == NULL) {
if (nameserver_remotenotify_state.gate_handle != NULL) if (nameserver_remotenotify_state.gate_handle != NULL)
kfree(nameserver_remotenotify_state.gate_handle); kfree(nameserver_remotenotify_state.gate_handle);
}
nameserver_remotenotify_state.is_setup = false; nameserver_remotenotify_state.is_setup = false;
return 0; return 0;
...@@ -242,11 +213,7 @@ void nameserver_remotenotify_params_init(void *handle, ...@@ -242,11 +213,7 @@ void nameserver_remotenotify_params_init(void *handle,
struct nameserver_remotenotify_object *object = NULL; struct nameserver_remotenotify_object *object = NULL;
struct nameserver_remotenotify_obj *obj = NULL; struct nameserver_remotenotify_obj *obj = NULL;
gt_2trace(nameserver_remotenotify_mask, GT_ENTER,
"nameserver_remotenotify_params_init:\n"
" handle: %x, params: %x\n", handle, params);
BUG_ON(params == NULL); BUG_ON(params == NULL);
object = (struct nameserver_remotenotify_object *)handle; object = (struct nameserver_remotenotify_object *)handle;
if (handle == NULL) if (handle == NULL)
memcpy(params, memcpy(params,
...@@ -275,11 +242,14 @@ void nameserver_remotenotify_callback(u16 proc_id, u32 event_no, ...@@ -275,11 +242,14 @@ void nameserver_remotenotify_callback(u16 proc_id, u32 event_no,
u32 proc_count; u32 proc_count;
u16 offset = 0; u16 offset = 0;
void *nshandle = NULL; void *nshandle = NULL;
u32 value; char value[MAX_VALUE_LEN] = { 0 }; /* To take care of value len > 4,
do we need to make it global? */
u32 key; u32 key;
s32 retval = 0; s32 retval = 0;
BUG_ON(arg == NULL); if (WARN_ON(arg == NULL))
return;
proc_count = multiproc_get_max_processors(); proc_count = multiproc_get_max_processors();
if (WARN_ON(proc_id >= proc_count)) if (WARN_ON(proc_id >= proc_count))
return; return;
...@@ -301,10 +271,15 @@ void nameserver_remotenotify_callback(u16 proc_id, u32 event_no, ...@@ -301,10 +271,15 @@ void nameserver_remotenotify_callback(u16 proc_id, u32 event_no,
handle->msg[1 - offset]->value_len); handle->msg[1 - offset]->value_len);
key = gatepeterson_enter(handle->params.gate); key = gatepeterson_enter(handle->params.gate);
/* If retval != 0 then an entry was found */ /* If retval > 0 then an entry found */
if (retval > 0) { if (retval > 0) {
handle->msg[1 - offset]->request_status = true; handle->msg[1 - offset]->request_status = true;
handle->msg[1 - offset]->value = value; if (handle->msg[1 - offset]->value_len == sizeof(u32))
memcpy(&(handle->msg[1 - offset]->value), &value,
sizeof(u32));
else
memcpy(&(handle->msg[1 - offset]->value_buf), &value,
handle->msg[1 - offset]->value_len);
} }
/* Send a response back */ /* Send a response back */
handle->msg[1 - offset]->response = true; handle->msg[1 - offset]->response = true;
...@@ -332,7 +307,7 @@ exit: ...@@ -332,7 +307,7 @@ exit:
*/ */
int nameserver_remotenotify_get(void *rhandle, int nameserver_remotenotify_get(void *rhandle,
const char *instance_name, const char *name, const char *instance_name, const char *name,
u8 *value, u32 value_len, void *reserved) void *value, u32 value_len, void *reserved)
{ {
struct nameserver_remotenotify_object *handle = NULL; struct nameserver_remotenotify_object *handle = NULL;
struct nameserver_remotenotify_obj *obj = NULL; struct nameserver_remotenotify_obj *obj = NULL;
...@@ -341,11 +316,6 @@ int nameserver_remotenotify_get(void *rhandle, ...@@ -341,11 +316,6 @@ int nameserver_remotenotify_get(void *rhandle,
u32 key; u32 key;
s32 retval = 0; s32 retval = 0;
gt_5trace(nameserver_remotenotify_mask, GT_6CLASS,
"nameserver_remotenotify_get:\n instance_name: %s,\n"
" name: %s,\n handle = %x, value:"
" %x,\n value_len: %x \n", instance_name, name, rhandle,
value, value_len);
BUG_ON(instance_name == NULL); BUG_ON(instance_name == NULL);
BUG_ON(name == NULL); BUG_ON(name == NULL);
BUG_ON(value == NULL); BUG_ON(value == NULL);
...@@ -371,7 +341,7 @@ int nameserver_remotenotify_get(void *rhandle, ...@@ -371,7 +341,7 @@ int nameserver_remotenotify_get(void *rhandle,
obj->msg[offset]->response = 0; obj->msg[offset]->response = 0;
obj->msg[offset]->request_status = 0; obj->msg[offset]->request_status = 0;
obj->msg[offset]->value_len = value_len; obj->msg[offset]->value_len = value_len;
len = strlen(instance_name); len = strlen(instance_name) + 1; /* Take termination null char */
strncpy(obj->msg[offset]->instance_name, instance_name, len); strncpy(obj->msg[offset]->instance_name, instance_name, len);
len = strlen(name); len = strlen(name);
strncpy(obj->msg[offset]->name, name, len); strncpy(obj->msg[offset]->name, name, len);
...@@ -380,8 +350,8 @@ int nameserver_remotenotify_get(void *rhandle, ...@@ -380,8 +350,8 @@ int nameserver_remotenotify_get(void *rhandle,
retval = notify_sendevent(obj->params.notify_driver, retval = notify_sendevent(obj->params.notify_driver,
obj->remote_proc_id, obj->remote_proc_id,
obj->params.notify_event_no, obj->params.notify_event_no,
0, 0, /* Payload */
true); false); /* Not sending a payload */
if (retval < 0) if (retval < 0)
goto notify_error; goto notify_error;
...@@ -405,14 +375,13 @@ int nameserver_remotenotify_get(void *rhandle, ...@@ -405,14 +375,13 @@ int nameserver_remotenotify_get(void *rhandle,
sizeof(u32)); sizeof(u32));
else else
memcpy((void *)value, memcpy((void *)value,
(void *)&(obj->msg[offset]->value), (void *)&(obj->msg[offset]->value_buf),
value_len); value_len);
obj->msg[offset]->request_status = false; obj->msg[offset]->request_status = false;
obj->msg[offset]->request = 0; obj->msg[offset]->request = 0;
obj->msg[offset]->response = 0; obj->msg[offset]->response = 0;
gatepeterson_leave(obj->params.gate, key); retval = value_len;
return 0;
notify_error: notify_error:
gatepeterson_leave(obj->params.gate, key); gatepeterson_leave(obj->params.gate, key);
...@@ -429,8 +398,6 @@ exit: ...@@ -429,8 +398,6 @@ exit:
int nameServer_remote_notify_params_init( int nameServer_remote_notify_params_init(
struct nameserver_remotenotify_params *params) struct nameserver_remotenotify_params *params)
{ {
gt_1trace(nameserver_remotenotify_mask, GT_ENTER,
"nameserver_remote_get_config:\n params: %x\n", params);
BUG_ON(params == NULL); BUG_ON(params == NULL);
params->notify_event_no = 0; params->notify_event_no = 0;
...@@ -456,14 +423,6 @@ void *nameserver_remotenotify_create(u16 proc_id, ...@@ -456,14 +423,6 @@ void *nameserver_remotenotify_create(u16 proc_id,
u32 offset = 0; u32 offset = 0;
BUG_ON(params == NULL); BUG_ON(params == NULL);
gt_5trace(nameserver_remotenotify_mask, GT_6CLASS,
"nameserver_remotenotify_create:\n"
"params: %x, shared_addr: %x, \n"
"shared_addr_size: %x, notify_driver: %x,\n"
"proc_id: %x\n", params, params->shared_addr,
params->shared_addr_size, params->notify_driver,
proc_id);
if (WARN_ON(params->notify_driver == NULL || if (WARN_ON(params->notify_driver == NULL ||
params->shared_addr == NULL || params->shared_addr == NULL ||
params->shared_addr_size == 0)) { params->shared_addr_size == 0)) {
...@@ -504,21 +463,19 @@ void *nameserver_remotenotify_create(u16 proc_id, ...@@ -504,21 +463,19 @@ void *nameserver_remotenotify_create(u16 proc_id,
NAMESERVERREMOTENOTIFY_CACHESIZE); NAMESERVERREMOTENOTIFY_CACHESIZE);
obj->msg[1] = (struct nameserver_remotenotify_message *) obj->msg[1] = (struct nameserver_remotenotify_message *)
((u32)obj->msg[0] + ((u32)obj->msg[0] +
NAMESERVERREMOTENOTIFY_CACHESIZE); sizeof(struct
nameserver_remotenotify_message));
/* Clear out self shared structures */ /* Clear out self shared structures */
memset(obj->msg[offset], 0, NAMESERVERREMOTENOTIFY_CACHESIZE); memset(obj->msg[offset], 0,
sizeof(struct nameserver_remotenotify_message));
memcpy(&obj->params, params, memcpy(&obj->params, params,
sizeof(struct nameserver_remotenotify_params)); sizeof(struct nameserver_remotenotify_params));
retval = notify_register_event(params->notify_driver, proc_id, retval = notify_register_event(params->notify_driver, proc_id,
params->notify_event_no, params->notify_event_no,
nameserver_remotenotify_callback, nameserver_remotenotify_callback,
(void *)obj); (void *)obj);
if (retval < 0) { if (retval < 0)
gt_0trace(nameserver_remotenotify_mask, GT_6CLASS,
"nameserver_remotenotify_create: notify register"
"events failed!\n");
goto notify_error; goto notify_error;
}
retval = nameserver_register_remote_driver((void *)handle, proc_id); retval = nameserver_register_remote_driver((void *)handle, proc_id);
obj->sem_handle = kmalloc(sizeof(struct semaphore), GFP_KERNEL); obj->sem_handle = kmalloc(sizeof(struct semaphore), GFP_KERNEL);
...@@ -528,7 +485,6 @@ void *nameserver_remotenotify_create(u16 proc_id, ...@@ -528,7 +485,6 @@ void *nameserver_remotenotify_create(u16 proc_id,
} }
sema_init(obj->sem_handle, 0); sema_init(obj->sem_handle, 0);
/* its is at the end since its init state = unlocked? */ /* its is at the end since its init state = unlocked? */
mutex_init(obj->local_gate); mutex_init(obj->local_gate);
return (void *)handle; return (void *)handle;
...@@ -566,10 +522,7 @@ int nameserver_remotenotify_delete(void **rhandle) ...@@ -566,10 +522,7 @@ int nameserver_remotenotify_delete(void **rhandle)
s32 retval = 0; s32 retval = 0;
struct mutex *gate = NULL; struct mutex *gate = NULL;
gt_1trace(nameserver_remotenotify_mask, GT_ENTER,
"nameserver_remotenotify_delete:\n rhandle: %x\n", rhandle);
BUG_ON(rhandle == NULL); BUG_ON(rhandle == NULL);
if (WARN_ON(*rhandle == NULL)) { if (WARN_ON(*rhandle == NULL)) {
retval = -EINVAL; retval = -EINVAL;
goto exit; goto exit;
...@@ -579,11 +532,8 @@ int nameserver_remotenotify_delete(void **rhandle) ...@@ -579,11 +532,8 @@ int nameserver_remotenotify_delete(void **rhandle)
obj = (struct nameserver_remotenotify_obj *)handle->obj; obj = (struct nameserver_remotenotify_obj *)handle->obj;
retval = mutex_lock_interruptible(obj->local_gate); retval = mutex_lock_interruptible(obj->local_gate);
if (retval) { if (retval)
gt_0trace(nameserver_remotenotify_mask, GT_6CLASS,
"nameserver_remotenotify_delete: lock failed!\n");
goto exit; goto exit;
}
retval = nameserver_unregister_remote_driver(obj->remote_proc_id); retval = nameserver_unregister_remote_driver(obj->remote_proc_id);
/* Do we have to bug_on/warn_on oops here intead of exit ?*/ /* Do we have to bug_on/warn_on oops here intead of exit ?*/
...@@ -625,9 +575,6 @@ u32 nameserver_remotenotify_shared_memreq(const ...@@ -625,9 +575,6 @@ u32 nameserver_remotenotify_shared_memreq(const
/* params is not used- to remove warning. */ /* params is not used- to remove warning. */
(void)params; (void)params;
gt_1trace(nameserver_remotenotify_mask, GT_ENTER,
"nameserver_remotenotify_shared_memreq:\n"
" params: %x\n", params);
BUG_ON(params == NULL); BUG_ON(params == NULL);
/* /*
* The attrs takes a Ipc_cacheSize plus 2 Message structs are required. * The attrs takes a Ipc_cacheSize plus 2 Message structs are required.
......
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