mirror of
https://github.com/linux-msm/diag.git
synced 2024-11-30 13:33:46 +08:00
dm: Return newly created dm object
In order for the usb code to be able to post messages on the DM return the handle to the newly created object. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
parent
6a96be0210
commit
c3beba72f7
@ -65,7 +65,7 @@ struct list_head diag_clients = LIST_INIT(diag_clients);
|
||||
* dm_add() - register new DM
|
||||
* @dm: DM object to register
|
||||
*/
|
||||
void dm_add(const char *name, int in_fd, int out_fd, bool hdlc_encoded)
|
||||
struct diag_client *dm_add(const char *name, int in_fd, int out_fd, bool hdlc_encoded)
|
||||
{
|
||||
struct diag_client *dm;
|
||||
|
||||
@ -83,6 +83,8 @@ void dm_add(const char *name, int in_fd, int out_fd, bool hdlc_encoded)
|
||||
watch_add_writeq(dm->out_fd, &dm->outq);
|
||||
|
||||
list_add(&diag_clients, &dm->node);
|
||||
|
||||
return dm;
|
||||
}
|
||||
|
||||
static int dm_recv_hdlc(struct diag_client *dm)
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
struct diag_client;
|
||||
|
||||
void dm_add(const char *name, int in_fd, int out_fd, bool hdlc_encoded);
|
||||
struct diag_client *dm_add(const char *name, int in_fd, int out_fd, bool hdlc_encoded);
|
||||
int dm_recv(int fd, void* data);
|
||||
ssize_t dm_send(struct diag_client *dm, const void *ptr, size_t len);
|
||||
void dm_broadcast(const void *ptr, size_t len);
|
||||
|
Loading…
Reference in New Issue
Block a user