[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH 05/10] plat/xen/drivers/cons: Get Consfront info
Provides driver specific information to the API, such as min/max number of descriptors for rx/tx. Signed-off-by: Birlea Costin <costin.birlea@xxxxxxxxx> --- plat/xen/drivers/cons/consfront.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/plat/xen/drivers/cons/consfront.c b/plat/xen/drivers/cons/consfront.c index 8c0980b6..33adabf7 100644 --- a/plat/xen/drivers/cons/consfront.c +++ b/plat/xen/drivers/cons/consfront.c @@ -49,12 +49,47 @@ #define DRIVER_NAME "xen-consfront" +/* Xencons_interface in and out limits + * imposed by xen/io/console.h public header */ +#define XEN_CONSFRONT_SIZE_IN 1024 +#define XEN_CONSFRONT_SIZE_OUT 2048 + /* Get consfront_dev* which contains consdev */ #define to_consfront(dev) \ __containerof(dev, struct consfront_dev, consdev) static struct uk_alloc *drv_allocator; +static void consfront_info_get(struct uk_consdev *dev __unused, + struct uk_consdev_info *dev_info) +{ + UK_ASSERT(dev_info); +} + +static int consfront_rx_info_get(struct uk_consdev *dev __unused, + struct uk_consdev_ring_info *ring_info) +{ + UK_ASSERT(ring_info); + + ring_info->nb_min = XEN_CONSFRONT_SIZE_IN; + ring_info->nb_max = XEN_CONSFRONT_SIZE_IN; + ring_info->nb_is_power_of_two = 0; + + return 0; +} + +static int consfront_tx_info_get(struct uk_consdev *dev __unused, + struct uk_consdev_ring_info *ring_info) +{ + UK_ASSERT(ring_info); + + ring_info->nb_min = XEN_CONSFRONT_SIZE_OUT; + ring_info->nb_max = XEN_CONSFRONT_SIZE_OUT; + ring_info->nb_is_power_of_two = 0; + + return 0; +} + static void consfront_close(struct uk_consdev *dev) { struct consfront_dev *cfdev; @@ -72,6 +107,9 @@ static void consfront_close(struct uk_consdev *dev) } static const struct uk_consdev_ops consfront_ops = { + .info_get = consfront_info_get, + .rx_info_get = consfront_rx_info_get, + .tx_info_get = consfront_tx_info_get, .close = consfront_close, }; -- 2.11.0 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |