Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10df38ca authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: (44 commits)
  Add MAINTAINERS entry for virtio_console
  virtio: console: Fill ports' entire in_vq with buffers
  virtio: console: Error out if we can't allocate buffers for control queue
  virtio: console: Add ability to remove module
  virtio: console: Ensure no memleaks in case of unused buffers
  virtio: console: show error message if hvc_alloc fails for console ports
  virtio: console: Add debugfs files for each port to expose debug info
  virtio: console: Add ability to hot-unplug ports
  virtio: console: Handle port hot-plug
  virtio: console: Remove cached data on port close
  virtio: console: Register with sysfs and create a 'name' attribute for ports
  virtio: console: Ensure only one process can have a port open at a time
  virtio: console: Add file operations to ports for open/read/write/poll
  virtio: console: Associate each port with a char device
  virtio: console: Prepare for writing to userspace buffers
  virtio: console: Add a new MULTIPORT feature, support for generic ports
  virtio: console: Introduce a send_buf function for a common path for sending data to host
  virtio: console: Introduce function to hand off data from host to readers
  virtio: console: Separate out find_vqs operation into a different function
  virtio: console: Separate out console init into a new function
  ...
parents dbd00429 c6100286
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -34,7 +34,6 @@
#include <sys/uio.h>
#include <sys/uio.h>
#include <termios.h>
#include <termios.h>
#include <getopt.h>
#include <getopt.h>
#include <zlib.h>
#include <assert.h>
#include <assert.h>
#include <sched.h>
#include <sched.h>
#include <limits.h>
#include <limits.h>
+6 −0
Original line number Original line Diff line number Diff line
@@ -2393,6 +2393,12 @@ L: linuxppc-dev@ozlabs.org
S:	Odd Fixes
S:	Odd Fixes
F:	drivers/char/hvc_*
F:	drivers/char/hvc_*


VIRTIO CONSOLE DRIVER
M:	Amit Shah <amit.shah@redhat.com>
L:	virtualization@lists.linux-foundation.org
S:	Maintained
F:	drivers/char/virtio_console.c

GSPCA FINEPIX SUBDRIVER
GSPCA FINEPIX SUBDRIVER
M:	Frank Zago <frank@zago.net>
M:	Frank Zago <frank@zago.net>
L:	linux-media@vger.kernel.org
L:	linux-media@vger.kernel.org
+46 −15
Original line number Original line Diff line number Diff line
@@ -243,10 +243,12 @@ static int index_to_minor(int index)
static int __devinit virtblk_probe(struct virtio_device *vdev)
static int __devinit virtblk_probe(struct virtio_device *vdev)
{
{
	struct virtio_blk *vblk;
	struct virtio_blk *vblk;
	struct request_queue *q;
	int err;
	int err;
	u64 cap;
	u64 cap;
	u32 v;
	u32 v, blk_size, sg_elems, opt_io_size;
	u32 blk_size, sg_elems;
	u16 min_io_size;
	u8 physical_block_exp, alignment_offset;


	if (index_to_minor(index) >= 1 << MINORBITS)
	if (index_to_minor(index) >= 1 << MINORBITS)
		return -ENOSPC;
		return -ENOSPC;
@@ -293,13 +295,13 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
		goto out_mempool;
		goto out_mempool;
	}
	}


	vblk->disk->queue = blk_init_queue(do_virtblk_request, &vblk->lock);
	q = vblk->disk->queue = blk_init_queue(do_virtblk_request, &vblk->lock);
	if (!vblk->disk->queue) {
	if (!q) {
		err = -ENOMEM;
		err = -ENOMEM;
		goto out_put_disk;
		goto out_put_disk;
	}
	}


	vblk->disk->queue->queuedata = vblk;
	q->queuedata = vblk;


	if (index < 26) {
	if (index < 26) {
		sprintf(vblk->disk->disk_name, "vd%c", 'a' + index % 26);
		sprintf(vblk->disk->disk_name, "vd%c", 'a' + index % 26);
@@ -323,10 +325,10 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)


	/* If barriers are supported, tell block layer that queue is ordered */
	/* If barriers are supported, tell block layer that queue is ordered */
	if (virtio_has_feature(vdev, VIRTIO_BLK_F_FLUSH))
	if (virtio_has_feature(vdev, VIRTIO_BLK_F_FLUSH))
		blk_queue_ordered(vblk->disk->queue, QUEUE_ORDERED_DRAIN_FLUSH,
		blk_queue_ordered(q, QUEUE_ORDERED_DRAIN_FLUSH,
				  virtblk_prepare_flush);
				  virtblk_prepare_flush);
	else if (virtio_has_feature(vdev, VIRTIO_BLK_F_BARRIER))
	else if (virtio_has_feature(vdev, VIRTIO_BLK_F_BARRIER))
		blk_queue_ordered(vblk->disk->queue, QUEUE_ORDERED_TAG, NULL);
		blk_queue_ordered(q, QUEUE_ORDERED_TAG, NULL);


	/* If disk is read-only in the host, the guest should obey */
	/* If disk is read-only in the host, the guest should obey */
	if (virtio_has_feature(vdev, VIRTIO_BLK_F_RO))
	if (virtio_has_feature(vdev, VIRTIO_BLK_F_RO))
@@ -345,14 +347,14 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
	set_capacity(vblk->disk, cap);
	set_capacity(vblk->disk, cap);


	/* We can handle whatever the host told us to handle. */
	/* We can handle whatever the host told us to handle. */
	blk_queue_max_phys_segments(vblk->disk->queue, vblk->sg_elems-2);
	blk_queue_max_phys_segments(q, vblk->sg_elems-2);
	blk_queue_max_hw_segments(vblk->disk->queue, vblk->sg_elems-2);
	blk_queue_max_hw_segments(q, vblk->sg_elems-2);


	/* No need to bounce any requests */
	/* No need to bounce any requests */
	blk_queue_bounce_limit(vblk->disk->queue, BLK_BOUNCE_ANY);
	blk_queue_bounce_limit(q, BLK_BOUNCE_ANY);


	/* No real sector limit. */
	/* No real sector limit. */
	blk_queue_max_sectors(vblk->disk->queue, -1U);
	blk_queue_max_sectors(q, -1U);


	/* Host can optionally specify maximum segment size and number of
	/* Host can optionally specify maximum segment size and number of
	 * segments. */
	 * segments. */
@@ -360,16 +362,45 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
				offsetof(struct virtio_blk_config, size_max),
				offsetof(struct virtio_blk_config, size_max),
				&v);
				&v);
	if (!err)
	if (!err)
		blk_queue_max_segment_size(vblk->disk->queue, v);
		blk_queue_max_segment_size(q, v);
	else
	else
		blk_queue_max_segment_size(vblk->disk->queue, -1U);
		blk_queue_max_segment_size(q, -1U);


	/* Host can optionally specify the block size of the device */
	/* Host can optionally specify the block size of the device */
	err = virtio_config_val(vdev, VIRTIO_BLK_F_BLK_SIZE,
	err = virtio_config_val(vdev, VIRTIO_BLK_F_BLK_SIZE,
				offsetof(struct virtio_blk_config, blk_size),
				offsetof(struct virtio_blk_config, blk_size),
				&blk_size);
				&blk_size);
	if (!err)
	if (!err)
		blk_queue_logical_block_size(vblk->disk->queue, blk_size);
		blk_queue_logical_block_size(q, blk_size);
	else
		blk_size = queue_logical_block_size(q);

	/* Use topology information if available */
	err = virtio_config_val(vdev, VIRTIO_BLK_F_TOPOLOGY,
			offsetof(struct virtio_blk_config, physical_block_exp),
			&physical_block_exp);
	if (!err && physical_block_exp)
		blk_queue_physical_block_size(q,
				blk_size * (1 << physical_block_exp));

	err = virtio_config_val(vdev, VIRTIO_BLK_F_TOPOLOGY,
			offsetof(struct virtio_blk_config, alignment_offset),
			&alignment_offset);
	if (!err && alignment_offset)
		blk_queue_alignment_offset(q, blk_size * alignment_offset);

	err = virtio_config_val(vdev, VIRTIO_BLK_F_TOPOLOGY,
			offsetof(struct virtio_blk_config, min_io_size),
			&min_io_size);
	if (!err && min_io_size)
		blk_queue_io_min(q, blk_size * min_io_size);

	err = virtio_config_val(vdev, VIRTIO_BLK_F_TOPOLOGY,
			offsetof(struct virtio_blk_config, opt_io_size),
			&opt_io_size);
	if (!err && opt_io_size)
		blk_queue_io_opt(q, blk_size * opt_io_size);



	add_disk(vblk->disk);
	add_disk(vblk->disk);
	return 0;
	return 0;
@@ -412,7 +443,7 @@ static struct virtio_device_id id_table[] = {
static unsigned int features[] = {
static unsigned int features[] = {
	VIRTIO_BLK_F_BARRIER, VIRTIO_BLK_F_SEG_MAX, VIRTIO_BLK_F_SIZE_MAX,
	VIRTIO_BLK_F_BARRIER, VIRTIO_BLK_F_SEG_MAX, VIRTIO_BLK_F_SIZE_MAX,
	VIRTIO_BLK_F_GEOMETRY, VIRTIO_BLK_F_RO, VIRTIO_BLK_F_BLK_SIZE,
	VIRTIO_BLK_F_GEOMETRY, VIRTIO_BLK_F_RO, VIRTIO_BLK_F_BLK_SIZE,
	VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_FLUSH
	VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_FLUSH, VIRTIO_BLK_F_TOPOLOGY
};
};


/*
/*
+8 −0
Original line number Original line Diff line number Diff line
@@ -666,6 +666,14 @@ config VIRTIO_CONSOLE
	help
	help
	  Virtio console for use with lguest and other hypervisors.
	  Virtio console for use with lguest and other hypervisors.


	  Also serves as a general-purpose serial device for data
	  transfer between the guest and host.  Character devices at
	  /dev/vportNpn will be created when corresponding ports are
	  found, where N is the device number and n is the port number
	  within that device.  If specified by the host, a sysfs
	  attribute called 'name' will be populated with a name for
	  the port which can be used by udev scripts to create a
	  symlink to the device.


config HVCS
config HVCS
	tristate "IBM Hypervisor Virtual Console Server support"
	tristate "IBM Hypervisor Virtual Console Server support"
+1 −1
Original line number Original line Diff line number Diff line
@@ -84,7 +84,7 @@ static int hvc_beat_put_chars(uint32_t vtermno, const char *buf, int cnt)
	return cnt;
	return cnt;
}
}


static struct hv_ops hvc_beat_get_put_ops = {
static const struct hv_ops hvc_beat_get_put_ops = {
	.get_chars = hvc_beat_get_chars,
	.get_chars = hvc_beat_get_chars,
	.put_chars = hvc_beat_put_chars,
	.put_chars = hvc_beat_put_chars,
};
};
Loading