History log of /drivers/bluetooth/hci_vhci.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
36acbb1adadf1ba300f14ee904a7d3f23120e0d6 13-Nov-2011 Andrei Emeltchenko <andrei.emeltchenko@intel.com> Bluetooth: Allow to set AMP type for virtual HCI

Type can be changed during re-opening device /dev/vhci.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
/drivers/bluetooth/hci_vhci.c
13ea4015d37d2dbe597580898b5fafbe6f593f72 26-Oct-2011 David Herrmann <dh.herrmann@googlemail.com> Bluetooth: Ignore hci_unregister_dev return value

Make all bluetooth drivers ignore the return value of hci_unregister_dev as it
always returns 0. In the next step, hci_unregister_dev can be modified to return
void.
Some of the drivers already ignore the return value (including btusb), hence,
this will increase consitency in the bluetooth drivers.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
/drivers/bluetooth/hci_vhci.c
6038f373a3dc1f1c26496e60b6c40b164716f07e 15-Aug-2010 Arnd Bergmann <arnd@arndb.de> llseek: automatically add .llseek fop

All file_operations should get a .llseek operation so we can make
nonseekable_open the default for future file operations without a
.llseek pointer.

The three cases that we can automatically detect are no_llseek, seq_lseek
and default_llseek. For cases where we can we can automatically prove that
the file offset is always ignored, we use noop_llseek, which maintains
the current behavior of not returning an error from a seek.

New drivers should normally not use noop_llseek but instead use no_llseek
and call nonseekable_open at open time. Existing drivers can be converted
to do the same when the maintainer knows for certain that no user code
relies on calling seek on the device file.

The generated code is often incorrectly indented and right now contains
comments that clarify for each added line why a specific variant was
chosen. In the version that gets submitted upstream, the comments will
be gone and I will manually fix the indentation, because there does not
seem to be a way to do that using coccinelle.

Some amount of new code is currently sitting in linux-next that should get
the same modifications, which I will do at the end of the merge window.

Many thanks to Julia Lawall for helping me learn to write a semantic
patch that does all this.

===== begin semantic patch =====
// This adds an llseek= method to all file operations,
// as a preparation for making no_llseek the default.
//
// The rules are
// - use no_llseek explicitly if we do nonseekable_open
// - use seq_lseek for sequential files
// - use default_llseek if we know we access f_pos
// - use noop_llseek if we know we don't access f_pos,
// but we still want to allow users to call lseek
//
@ open1 exists @
identifier nested_open;
@@
nested_open(...)
{
<+...
nonseekable_open(...)
...+>
}

@ open exists@
identifier open_f;
identifier i, f;
identifier open1.nested_open;
@@
int open_f(struct inode *i, struct file *f)
{
<+...
(
nonseekable_open(...)
|
nested_open(...)
)
...+>
}

@ read disable optional_qualifier exists @
identifier read_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
expression E;
identifier func;
@@
ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
{
<+...
(
*off = E
|
*off += E
|
func(..., off, ...)
|
E = *off
)
...+>
}

@ read_no_fpos disable optional_qualifier exists @
identifier read_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
@@
ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
{
... when != off
}

@ write @
identifier write_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
expression E;
identifier func;
@@
ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
{
<+...
(
*off = E
|
*off += E
|
func(..., off, ...)
|
E = *off
)
...+>
}

@ write_no_fpos @
identifier write_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
@@
ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
{
... when != off
}

@ fops0 @
identifier fops;
@@
struct file_operations fops = {
...
};

@ has_llseek depends on fops0 @
identifier fops0.fops;
identifier llseek_f;
@@
struct file_operations fops = {
...
.llseek = llseek_f,
...
};

@ has_read depends on fops0 @
identifier fops0.fops;
identifier read_f;
@@
struct file_operations fops = {
...
.read = read_f,
...
};

@ has_write depends on fops0 @
identifier fops0.fops;
identifier write_f;
@@
struct file_operations fops = {
...
.write = write_f,
...
};

@ has_open depends on fops0 @
identifier fops0.fops;
identifier open_f;
@@
struct file_operations fops = {
...
.open = open_f,
...
};

// use no_llseek if we call nonseekable_open
////////////////////////////////////////////
@ nonseekable1 depends on !has_llseek && has_open @
identifier fops0.fops;
identifier nso ~= "nonseekable_open";
@@
struct file_operations fops = {
... .open = nso, ...
+.llseek = no_llseek, /* nonseekable */
};

@ nonseekable2 depends on !has_llseek @
identifier fops0.fops;
identifier open.open_f;
@@
struct file_operations fops = {
... .open = open_f, ...
+.llseek = no_llseek, /* open uses nonseekable */
};

// use seq_lseek for sequential files
/////////////////////////////////////
@ seq depends on !has_llseek @
identifier fops0.fops;
identifier sr ~= "seq_read";
@@
struct file_operations fops = {
... .read = sr, ...
+.llseek = seq_lseek, /* we have seq_read */
};

// use default_llseek if there is a readdir
///////////////////////////////////////////
@ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier readdir_e;
@@
// any other fop is used that changes pos
struct file_operations fops = {
... .readdir = readdir_e, ...
+.llseek = default_llseek, /* readdir is present */
};

// use default_llseek if at least one of read/write touches f_pos
/////////////////////////////////////////////////////////////////
@ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read.read_f;
@@
// read fops use offset
struct file_operations fops = {
... .read = read_f, ...
+.llseek = default_llseek, /* read accesses f_pos */
};

@ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier write.write_f;
@@
// write fops use offset
struct file_operations fops = {
... .write = write_f, ...
+ .llseek = default_llseek, /* write accesses f_pos */
};

// Use noop_llseek if neither read nor write accesses f_pos
///////////////////////////////////////////////////////////

@ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read_no_fpos.read_f;
identifier write_no_fpos.write_f;
@@
// write fops use offset
struct file_operations fops = {
...
.write = write_f,
.read = read_f,
...
+.llseek = noop_llseek, /* read and write both use no f_pos */
};

@ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier write_no_fpos.write_f;
@@
struct file_operations fops = {
... .write = write_f, ...
+.llseek = noop_llseek, /* write uses no f_pos */
};

@ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read_no_fpos.read_f;
@@
struct file_operations fops = {
... .read = read_f, ...
+.llseek = noop_llseek, /* read uses no f_pos */
};

@ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
@@
struct file_operations fops = {
...
+.llseek = noop_llseek, /* no read or write fn */
};
===== End semantic patch =====

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Julia Lawall <julia@diku.dk>
Cc: Christoph Hellwig <hch@infradead.org>
/drivers/bluetooth/hci_vhci.c
4f7ac1814ef6f0773e57ffd159a1dd57a3c80521 01-May-2010 Gustavo F. Padovan <padovan@profusion.mobi> Bluetooth: Fix wrong packet type count increment

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
/drivers/bluetooth/hci_vhci.c
c13854cef4751000b968d4e8ac95796562d5b96f 08-Feb-2010 Marcel Holtmann <marcel@holtmann.org> Bluetooth: Convert controller hdev->type to hdev->bus

The hdev->type is misnamed and should be actually hdev->bus instead. So
convert it now.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
/drivers/bluetooth/hci_vhci.c
fed4c2508b7419d0a55958fead6151b32def1683 03-Dec-2009 Marcel Holtmann <marcel@holtmann.org> Bluetooth: Fix miscdev ops owner for virtual driver

The /dev/vhci ops don't refer to the module and so it is possible to
unload the module while the file descriptor is in use. This was an
accidental removal after the cleanup.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
/drivers/bluetooth/hci_vhci.c
329ab1b3e6ceac3f77ab400206a97cc402624259 03-Dec-2009 Marcel Holtmann <marcel@holtmann.org> Bluetooth: Remove unused global minor variable

After the removal of the module parameter for setting the minor number,
this variable became unused. So just remove it.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
/drivers/bluetooth/hci_vhci.c
5990108cfcd3eb2d365c9ea6f82318be80c4e9d3 15-Oct-2009 Thomas Gleixner <tglx@linutronix.de> Bluetooth: Remove stub ioctl in hci_vhci

Remove the empty ioctl which just returns -EINVAL. vfs_ioctl() will
return -ENOTTY instead, but I doubt that any application will notice
the difference :)

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
/drivers/bluetooth/hci_vhci.c
405f55712dfe464b3240d7816cc4fe4174831be2 11-Jul-2009 Alexey Dobriyan <adobriyan@gmail.com> headers: smp_lock.h redux

* Remove smp_lock.h from files which don't need it (including some headers!)
* Add smp_lock.h to files which do need it
* Make smp_lock.h include conditional in hardirq.h
It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT

This will make hardirq.h inclusion cheaper for every PREEMPT=n config
(which includes allmodconfig/allyesconfig, BTW)

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/bluetooth/hci_vhci.c
092b85853b161a5ca285c429faf1cf2ff4318a01 08-Jun-2009 Marcel Holtmann <marcel@holtmann.org> Bluetooth: Remove unused and unneeded support in virtual driver

The virtual driver implements fasync and ioctl support, but it is not used
and unneeded due to its constraints via the Bluetooth core layer. So too
just make the driver simpler, remove support for both of them.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
/drivers/bluetooth/hci_vhci.c
3857abc622102b808de11ff3393d541b826ab952 08-Jun-2009 Marcel Holtmann <marcel@holtmann.org> Bluetooth: Remove BKL from open callback of virtual driver

The BKL push down added some BKL into the open callback of the virtual
driver. The driver is really simple and need no such locking and so just
remove it.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
/drivers/bluetooth/hci_vhci.c
4db7589f3d88c09d740560f1dcf2d4d843d918f2 08-Jun-2009 Marcel Holtmann <marcel@holtmann.org> Bluetooth: Use wait_event_interruptible for virtual driver

The virtual driver still uses a home grown way of waiting for events and
so just replace it with wait_event_interruptible. And while at it remove
the useless access_ok() checks.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
/drivers/bluetooth/hci_vhci.c
ac28494c51ad20c7ff9cb991eaeee359a500d88e 07-Jun-2009 Marcel Holtmann <marcel@holtmann.org> Bluetooth: Use only MISC_DYNAMIC_MINOR for virtual driver

Allowing to specify a specific misc minor number for the virtual driver
is pretty much useless and nobody is using this feature. So just remove
it and use MISC_DYNAMIC_MINOR all the time.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
/drivers/bluetooth/hci_vhci.c
a418b893a6af11ae73c762ed5b76c1bad6dc19d8 30-Nov-2008 Marcel Holtmann <marcel@holtmann.org> Bluetooth: Enable per-module dynamic debug messages

With the introduction of CONFIG_DYNAMIC_PRINTK_DEBUG it is possible to
allow debugging without having to recompile the kernel. This patch turns
all BT_DBG() calls into pr_debug() to support dynamic debug messages.

As a side effect all CONFIG_BT_*_DEBUG statements are now removed and
some broken debug entries have been fixed.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
/drivers/bluetooth/hci_vhci.c
63fbd24e5102eecfc9d049ed7f4be7f9a25f814f 18-Aug-2008 Marcel Holtmann <marcel@holtmann.org> [Bluetooth] Consolidate maintainers information

The Bluetooth entries for the MAINTAINERS file are a little bit too
much. Consolidate them into two entries. One for Bluetooth drivers and
another one for the Bluetooth subsystem.

Also the MODULE_AUTHOR should indicate the current maintainer of the
module and actually not the original author. Fix all Bluetooth modules
to provide current maintainer information.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
/drivers/bluetooth/hci_vhci.c
dbfb2df7e9fbd6e5ab8cd9b94b27767fe311fa0d 20-Jun-2008 Jonathan Corbet <corbet@lwn.net> Bluetooth VHCI: fasync BKL pushdown

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
/drivers/bluetooth/hci_vhci.c
8324af6dddac11f9f7e9df8b784f6949ddb61b5d 20-May-2008 Arnd Bergmann <arnd@arndb.de> bluetooth-vhci: BKL pushdown

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
/drivers/bluetooth/hci_vhci.c
924f0e4a06419fa1996425d1d2512030e43acbba 11-Jul-2007 Robert P. J. Day <rpjday@mindspring.com> [Bluetooth] Remove the redundant non-seekable llseek method

Remove the llseek method given that the open method already calls
nonseekable_open().

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
/drivers/bluetooth/hci_vhci.c
2b8693c0617e972fc0b2fd1ebf8de97e15b656c3 12-Feb-2007 Arjan van de Ven <arjan@linux.intel.com> [PATCH] mark struct file_operations const 3

Many struct file_operations in the kernel can be "const". Marking them const
moves these to the .rodata section, which avoids false sharing with potential
dirty data. In addition it'll catch accidental writes at compile time to
these shared resources.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/bluetooth/hci_vhci.c
0ac53939a06c610b394aeb0211b985804f2d2da3 08-Jul-2006 Marcel Holtmann <marcel@holtmann.org> [Bluetooth] Add HCI device identifier for SDIO cards

This patch assigns the next free HCI device identifier to Bluetooth
devices based on the SDIO interface.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
/drivers/bluetooth/hci_vhci.c
9c724357f432df5ddc83a62c8168414a604cd420 06-Jul-2006 Marcel Holtmann <marcel@holtmann.org> [Bluetooth] Code cleanup of the drivers source code

This patch is an attempt to cleanup the drivers source code to make all
Bluetooth drivers look more unique.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
/drivers/bluetooth/hci_vhci.c
27d35284258c596900e0e41c46932ec4abe6a7b1 03-Jul-2006 Marcel Holtmann <marcel@holtmann.org> [Bluetooth] Add platform device for virtual and serial devices

This patch adds a generic Bluetooth platform device that can be used
as parent device by virtual and serial devices.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
/drivers/bluetooth/hci_vhci.c
6ab3d5624e172c553004ecc862bfeac16d9d68b7 30-Jun-2006 Jörn Engel <joern@wohnheim.fh-wedel.de> Remove obsolete #include <linux/config.h>

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
/drivers/bluetooth/hci_vhci.c
089b1dbbde28f0f641c20beabba28fa89ab4fab9 07-Nov-2005 Deepak Saxena <dsaxena@plexity.net> [PATCH] bluetooth: kmalloc + memset -> kzalloc conversion

Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Cc: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/bluetooth/hci_vhci.c
0d48d93947dd9ea21c5cdc76a8581b06a4a39281 10-Aug-2005 Marcel Holtmann <marcel@holtmann.org> [Bluetooth]: Move packet type into the SKB control buffer

This patch moves the usage of packet type into the SKB control
buffer. After this patch it is now possible to shrink the sk_buff
structure and redefine its pkt_type.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
/drivers/bluetooth/hci_vhci.c
4aa769b99724953a6f322c648c0cfbe8c6616382 10-Aug-2005 Marcel Holtmann <marcel@holtmann.org> [Bluetooth]: Update and cleanup of the virtual HCI driver

This patch cleans up the virtual HCI driver. It also adds support for
the dynamic minor device number allocation.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
/drivers/bluetooth/hci_vhci.c
b03efcfb2180289718991bb984044ce6c5b7d1b0 08-Jul-2005 David S. Miller <davem@davemloft.net> [NET]: Transform skb_queue_len() binary tests into skb_queue_empty()

This is part of the grand scheme to eliminate the qlen
member of skb_queue_head, and subsequently remove the
'list' member of sk_buff.

Most users of skb_queue_len() want to know if the queue is
empty or not, and that's trivially done with skb_queue_empty()
which doesn't use the skb_queue_head->qlen member and instead
uses the queue list emptyness as the test.

Signed-off-by: David S. Miller <davem@davemloft.net>
/drivers/bluetooth/hci_vhci.c
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org> Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
/drivers/bluetooth/hci_vhci.c