libdect: add function to get file descriptor number
Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
parent
e789864557
commit
2bca18c9df
|
@ -79,6 +79,7 @@ enum dect_fd_events {
|
|||
|
||||
struct dect_fd;
|
||||
extern void *dect_fd_priv(struct dect_fd *dfd);
|
||||
extern int dect_fd_num(const struct dect_fd *dfd);
|
||||
extern void dect_handle_fd(struct dect_handle *dh, struct dect_fd *dfd,
|
||||
uint32_t events);
|
||||
/** @} */
|
||||
|
|
11
src/io.c
11
src/io.c
|
@ -65,6 +65,17 @@ void *dect_fd_priv(struct dect_fd *dfd)
|
|||
}
|
||||
EXPORT_SYMBOL(dect_fd_priv);
|
||||
|
||||
/**
|
||||
* Get the file descriptor number from a DECT file descriptor.
|
||||
*
|
||||
* @param dfd DECT file descriptor
|
||||
*/
|
||||
int dect_fd_num(const struct dect_fd *dfd)
|
||||
{
|
||||
return dfd->fd;
|
||||
}
|
||||
EXPORT_SYMBOL(dect_fd_num);
|
||||
|
||||
void dect_setup_fd(struct dect_fd *dfd,
|
||||
void (*cb)(struct dect_handle *, struct dect_fd *, uint32_t),
|
||||
void *data)
|
||||
|
|
Reference in New Issue