drivers/net/telnet.c: Now works like the loop device. A new interface called telnet_initialize() registers a telnet session "factory" device at /dev/telnet. Via ioctl, the factory device can create instances of the telnet character devices at /dev/telnetN to support Telnet sessions.

This commit is contained in:
Gregory Nutt
2015-12-07 13:48:06 -06:00
parent 3bd5f60a62
commit 8fdb173090
7 changed files with 231 additions and 107 deletions
+3 -2
View File
@@ -63,7 +63,7 @@ static int loop_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
* Private Data
****************************************************************************/
static const struct file_operations loop_fops =
static const struct file_operations g_loop_fops =
{
0, /* open */
0, /* close */
@@ -154,6 +154,7 @@ static int loop_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
default:
ret = -ENOTTY;
break;
}
return ret;
@@ -173,7 +174,7 @@ static int loop_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
void loop_register(void)
{
(void)register_driver("/dev/loop", &loop_fops, 0666, NULL);
(void)register_driver("/dev/loop", &g_loop_fops, 0666, NULL);
}
#endif /* CONFIG_DEV_LOOP */