dev/pipe: make pipe a type of device

Pipe have many differences with char device. The main difference is
altough pipe have both read and write, it is unidirectional in nature.
This commit is contained in:
Grissiom 2013-08-20 10:16:55 +08:00
parent 0340300f89
commit 7e68096a88
2 changed files with 2 additions and 1 deletions

View File

@ -224,7 +224,7 @@ rt_err_t rt_pipe_init(struct rt_pipe_device *pipe,
pipe->flag = flag; pipe->flag = flag;
/* create pipe */ /* create pipe */
pipe->parent.type = RT_Device_Class_Char; pipe->parent.type = RT_Device_Class_Pipe;
pipe->parent.init = RT_NULL; pipe->parent.init = RT_NULL;
pipe->parent.open = RT_NULL; pipe->parent.open = RT_NULL;
pipe->parent.close = RT_NULL; pipe->parent.close = RT_NULL;

View File

@ -739,6 +739,7 @@ enum rt_device_class_type
RT_Device_Class_SPIDevice, /**< SPI device */ RT_Device_Class_SPIDevice, /**< SPI device */
RT_Device_Class_SDIO, /**< SDIO bus device */ RT_Device_Class_SDIO, /**< SDIO bus device */
RT_Device_Class_PM, /**< PM pseudo device */ RT_Device_Class_PM, /**< PM pseudo device */
RT_Device_Class_Pipe, /**< Pipe device */
RT_Device_Class_Miscellaneous, /**< Miscellaneous device */ RT_Device_Class_Miscellaneous, /**< Miscellaneous device */
RT_Device_Class_Unknown /**< unknown device */ RT_Device_Class_Unknown /**< unknown device */
}; };