Displaying 20 results from an estimated 237 matches for "ports_device".
2010 Jan 29
3
virtio: console: Return -EFAULT on copy_xx_user errors, allow larger writes
...(void *)buf, count);
}
/*
@@ -874,7 +866,6 @@ static int remove_port(struct port *port)
cdev_del(&port->cdev);
discard_port_data(port);
- free_buf(port->outbuf);
kfree(port->name);
debugfs_remove(port->debugfs_file);
@@ -1143,11 +1134,6 @@ static int add_port(struct ports_device *portdev, u32 id)
err = -ENOMEM;
goto free_device;
}
- port->outbuf = alloc_buf(PAGE_SIZE);
- if (!port->outbuf) {
- err = -ENOMEM;
- goto free_inbuf;
- }
/* Register the input buffer the first time. */
add_inbuf(port->in_vq, inbuf);
@@ -1158,7 +1144,7 @@ static int add_por...
2010 Jan 29
3
virtio: console: Return -EFAULT on copy_xx_user errors, allow larger writes
...(void *)buf, count);
}
/*
@@ -874,7 +866,6 @@ static int remove_port(struct port *port)
cdev_del(&port->cdev);
discard_port_data(port);
- free_buf(port->outbuf);
kfree(port->name);
debugfs_remove(port->debugfs_file);
@@ -1143,11 +1134,6 @@ static int add_port(struct ports_device *portdev, u32 id)
err = -ENOMEM;
goto free_device;
}
- port->outbuf = alloc_buf(PAGE_SIZE);
- if (!port->outbuf) {
- err = -ENOMEM;
- goto free_inbuf;
- }
/* Register the input buffer the first time. */
add_inbuf(port->in_vq, inbuf);
@@ -1158,7 +1144,7 @@ static int add_por...
2012 Feb 01
1
[PATCH 2/2] virtio-serial: setup_port_vq when adding port
...t; @@ -1132,6 +1132,55 @@ static void send_sigio_to_port(struct port *port)
> kill_fasync(&port->async_queue, SIGIO, POLL_OUT);
> }
>
> +static void in_intr(struct virtqueue *vq);
> +static void out_intr(struct virtqueue *vq);
> +
> +static int setup_port_vq(struct ports_device *portdev, u32 id)
> +{
> + int err, vq_num;
> + vq_callback_t **io_callbacks;
> + char **io_names;
> + struct virtqueue **vqs;
> + u32 i,j,nr_ports,nr_queues;
> +
> + err = 0;
> + vq_num = (id + 1) * 2;
> + nr_ports = portdev->config.max_nr_ports;
> + nr_queues...
2012 Feb 01
1
[PATCH 2/2] virtio-serial: setup_port_vq when adding port
...t; @@ -1132,6 +1132,55 @@ static void send_sigio_to_port(struct port *port)
> kill_fasync(&port->async_queue, SIGIO, POLL_OUT);
> }
>
> +static void in_intr(struct virtqueue *vq);
> +static void out_intr(struct virtqueue *vq);
> +
> +static int setup_port_vq(struct ports_device *portdev, u32 id)
> +{
> + int err, vq_num;
> + vq_callback_t **io_callbacks;
> + char **io_names;
> + struct virtqueue **vqs;
> + u32 i,j,nr_ports,nr_queues;
> +
> + err = 0;
> + vq_num = (id + 1) * 2;
> + nr_ports = portdev->config.max_nr_ports;
> + nr_queues...
2014 Dec 01
0
[PATCH v8 47/50] virtio_console: virtio 1.0 support
...for the key */
};
/* Some events for control messages */
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 8d00aa7..775c898 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -566,9 +566,9 @@ static ssize_t __send_control_msg(struct ports_device *portdev, u32 port_id,
if (!use_multiport(portdev))
return 0;
- cpkt.id = port_id;
- cpkt.event = event;
- cpkt.value = value;
+ cpkt.id = cpu_to_virtio32(portdev->vdev, port_id);
+ cpkt.event = cpu_to_virtio16(portdev->vdev, event);
+ cpkt.value = cpu_to_virtio16(portdev->vdev, val...
2014 Dec 01
0
[PATCH v8 47/50] virtio_console: virtio 1.0 support
...for the key */
};
/* Some events for control messages */
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 8d00aa7..775c898 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -566,9 +566,9 @@ static ssize_t __send_control_msg(struct ports_device *portdev, u32 port_id,
if (!use_multiport(portdev))
return 0;
- cpkt.id = port_id;
- cpkt.event = event;
- cpkt.value = value;
+ cpkt.id = cpu_to_virtio32(portdev->vdev, port_id);
+ cpkt.event = cpu_to_virtio16(portdev->vdev, event);
+ cpkt.value = cpu_to_virtio16(portdev->vdev, val...
2012 Sep 19
2
[PATCHv2] virtio_console: Add support for remoteproc serial
...&vdev->dev;
+ dma_addr_t dma_handle = virt_to_bus(cpu_addr);
+ dev = dev->parent ? dev->parent : dev;
+ dev = dev->parent ? dev->parent : dev;
+ dma_free_coherent(dev, size, cpu_addr, dma_handle);
+ return;
+ }
+ kfree(cpu_addr);
+}
+
static inline bool use_multiport(struct ports_device *portdev)
{
/*
@@ -334,20 +382,22 @@ static inline bool use_multiport(struct ports_device *portdev)
return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
}
-static void free_buf(struct port_buffer *buf)
+static void
+free_buf(struct virtqueue *vq, struct por...
2012 Sep 19
2
[PATCHv2] virtio_console: Add support for remoteproc serial
...&vdev->dev;
+ dma_addr_t dma_handle = virt_to_bus(cpu_addr);
+ dev = dev->parent ? dev->parent : dev;
+ dev = dev->parent ? dev->parent : dev;
+ dma_free_coherent(dev, size, cpu_addr, dma_handle);
+ return;
+ }
+ kfree(cpu_addr);
+}
+
static inline bool use_multiport(struct ports_device *portdev)
{
/*
@@ -334,20 +382,22 @@ static inline bool use_multiport(struct ports_device *portdev)
return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
}
-static void free_buf(struct port_buffer *buf)
+static void
+free_buf(struct virtqueue *vq, struct por...
2010 Mar 30
3
[PATCH 4/4] virtio: disable multiport console support.
...diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -252,15 +252,10 @@ static bool is_console_port(struct port
return false;
}
+/* This is incomplete. */
static inline bool use_multiport(struct ports_device *portdev)
{
- /*
- * This condition can be true when put_chars is called from
- * early_init
- */
- if (!portdev->vdev)
- return 0;
- return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
+ return false;
}
static void free_buf(struct port_buffer *buf)
@@...
2010 Mar 30
3
[PATCH 4/4] virtio: disable multiport console support.
...diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -252,15 +252,10 @@ static bool is_console_port(struct port
return false;
}
+/* This is incomplete. */
static inline bool use_multiport(struct ports_device *portdev)
{
- /*
- * This condition can be true when put_chars is called from
- * early_init
- */
- if (!portdev->vdev)
- return 0;
- return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
+ return false;
}
static void free_buf(struct port_buffer *buf)
@@...
2013 Mar 29
3
[PATCH v2 0/2] virtio: console: add locking around control out-vq
The in-vq operations were protected by a lock, but the out-vq
operations were not. This caused panics / errors as described in
patch 2. Fix that.
The first patch renames the existing cvq_lock to c_ivq_lock to match
c_ivq. The second patch introduces the c_ovq_lock for the c_ovq.
Please apply. I also believe this is a candidate for stable.
v2:
* Use spin_lock instead of spin_lock_irq.
2013 Mar 29
3
[PATCH v2 0/2] virtio: console: add locking around control out-vq
The in-vq operations were protected by a lock, but the out-vq
operations were not. This caused panics / errors as described in
patch 2. Fix that.
The first patch renames the existing cvq_lock to c_ivq_lock to match
c_ivq. The second patch introduces the c_ovq_lock for the c_ovq.
Please apply. I also believe this is a candidate for stable.
v2:
* Use spin_lock instead of spin_lock_irq.
2012 Sep 13
0
[PATCH] virtio_console: Add support for remoteproc serial
...&vdev->dev;
+ dma_addr_t dma_handle = virt_to_bus(cpu_addr);
+ dev = dev->parent ? dev->parent : dev;
+ dev = dev->parent ? dev->parent : dev;
+ dma_free_coherent(dev, size, cpu_addr, dma_handle);
+ return;
+ }
+ kfree(cpu_addr);
+}
+
static inline bool use_multiport(struct ports_device *portdev)
{
/*
@@ -334,20 +382,22 @@ static inline bool use_multiport(struct ports_device *portdev)
return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
}
-static void free_buf(struct port_buffer *buf)
+static void
+free_buf(struct virtqueue *vq, struct por...
2012 Sep 13
0
[PATCH] virtio_console: Add support for remoteproc serial
...&vdev->dev;
+ dma_addr_t dma_handle = virt_to_bus(cpu_addr);
+ dev = dev->parent ? dev->parent : dev;
+ dev = dev->parent ? dev->parent : dev;
+ dma_free_coherent(dev, size, cpu_addr, dma_handle);
+ return;
+ }
+ kfree(cpu_addr);
+}
+
static inline bool use_multiport(struct ports_device *portdev)
{
/*
@@ -334,20 +382,22 @@ static inline bool use_multiport(struct ports_device *portdev)
return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
}
-static void free_buf(struct port_buffer *buf)
+static void
+free_buf(struct virtqueue *vq, struct por...
2013 Jan 17
4
[PATCH] virtio_console: Use virtio device index to generate port name
...ll the devices we're handling */
struct list_head portdevs;
- /* Number of devices this driver is handling */
- unsigned int index;
-
/*
* This is used to keep track of the number of hvc consoles
* spawned by this driver. This number is given as the first
@@ -169,9 +166,6 @@ struct ports_device {
/* Array of per-port IO virtqueues */
struct virtqueue **in_vqs, **out_vqs;
- /* Used for numbering devices for sysfs and debugfs */
- unsigned int drv_index;
-
/* Major number for this device. Ports will be created as minors. */
int chr_major;
};
@@ -1415,7 +1409,7 @@ static int add_...
2013 Jan 17
4
[PATCH] virtio_console: Use virtio device index to generate port name
...ll the devices we're handling */
struct list_head portdevs;
- /* Number of devices this driver is handling */
- unsigned int index;
-
/*
* This is used to keep track of the number of hvc consoles
* spawned by this driver. This number is given as the first
@@ -169,9 +166,6 @@ struct ports_device {
/* Array of per-port IO virtqueues */
struct virtqueue **in_vqs, **out_vqs;
- /* Used for numbering devices for sysfs and debugfs */
- unsigned int drv_index;
-
/* Major number for this device. Ports will be created as minors. */
int chr_major;
};
@@ -1415,7 +1409,7 @@ static int add_...
2013 Mar 28
5
[PATCH 0/2] virtio: console: add locking around control out-vq
The in-vq operations were protected by a lock, but the out-vq
operations were not. This caused panics / errors as described in
patch 2. Fix that.
The first patch renames the existing cvq_lock to c_ivq_lock to match
c_ivq. The second patch introduces the c_ovq_lock for the c_ovq.
Please apply. I also believe this is a candidate for stable.
Amit Shah (2):
virtio: console: rename cvq_lock
2013 Mar 28
5
[PATCH 0/2] virtio: console: add locking around control out-vq
The in-vq operations were protected by a lock, but the out-vq
operations were not. This caused panics / errors as described in
patch 2. Fix that.
The first patch renames the existing cvq_lock to c_ivq_lock to match
c_ivq. The second patch introduces the c_ovq_lock for the c_ovq.
Please apply. I also believe this is a candidate for stable.
Amit Shah (2):
virtio: console: rename cvq_lock
2014 Oct 20
4
[PATCH v4 13/25] virtio_console: enable VQs early
...gt; > > diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
> > > index b585b47..6ebe8f6 100644
> > > --- a/drivers/char/virtio_console.c
> > > +++ b/drivers/char/virtio_console.c
> > > @@ -1449,6 +1449,8 @@ static int add_port(struct ports_device *portdev, u32 id)
> > > spin_lock_init(&port->outvq_lock);
> > > init_waitqueue_head(&port->waitqueue);
> > >
> > > + virtio_device_ready(portdev->vdev);
> > > +
> > > /* Fill the in_vq with buffers so the host can send...
2014 Oct 20
4
[PATCH v4 13/25] virtio_console: enable VQs early
...gt; > > diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
> > > index b585b47..6ebe8f6 100644
> > > --- a/drivers/char/virtio_console.c
> > > +++ b/drivers/char/virtio_console.c
> > > @@ -1449,6 +1449,8 @@ static int add_port(struct ports_device *portdev, u32 id)
> > > spin_lock_init(&port->outvq_lock);
> > > init_waitqueue_head(&port->waitqueue);
> > >
> > > + virtio_device_ready(portdev->vdev);
> > > +
> > > /* Fill the in_vq with buffers so the host can send...