linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Hurley <peter@hurleysoftware.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Frederic Danis <frederic.danis@linux.intel.com>,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 2/7] Bluetooth: hci_uart: Add HCIUARTSETBAUDRATE ioctl
Date: Fri, 10 Apr 2015 15:05:42 -0400	[thread overview]
Message-ID: <55281F06.7020104@hurleysoftware.com> (raw)
In-Reply-To: <488A23CF-9578-42F5-A2E6-9D8450A15309@holtmann.org>

On 04/10/2015 02:20 PM, Marcel Holtmann wrote:
> Hi Peter,
> 
>>> This allows user space application to set final speed requested for UART
>>> device. UART port is open at init speed by user space application.
>>>
>>> Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
>>> ---
>>> drivers/bluetooth/hci_ldisc.c | 6 ++++++
>>> drivers/bluetooth/hci_uart.h  | 2 ++
>>> 2 files changed, 8 insertions(+)
>>>
>>> diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
>>> index 5c9a73f..190a7f8 100644
>>> --- a/drivers/bluetooth/hci_ldisc.c
>>> +++ b/drivers/bluetooth/hci_ldisc.c
>>> @@ -609,6 +609,12 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file *file,
>>> 	case HCIUARTGETFLAGS:
>>> 		return hu->hdev_flags;
>>>
>>> +	case HCIUARTSETBAUDRATE:
>>> +		if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
>>> +			return -EBUSY;
>>> +		hu->speed = arg;
>>> +		break;
>>> +
>>
>> So now that the kernel can set line rate, why is an ioctl necessary
>> to determine what the line rate should be?
> 
> actually I think we should skip this for now and only introduce it if it is really needed. For the chips we want to support initially we only need the default baudrate and the max baudrate. So the default baudrate is vendor specific and we would just hardcode that in the driver. The max baudrate is platform specific and most likely should come via ACPI or DT. Or some default value in case it is platform specific driver in the first place.
> 
> Just as background, this command is not for actually setting the baudrate at that point, it is informing the kernel about the max baudrate for operational use. It will be programmed way later. However as stated above, I think for now we should skip this and only introduce it if the kernel needs input from userspace on the max baudrate.

Or through sysfs.

> Fred, I think what we really want at this point is to add default and operational baudrate fields to hci_uart_proto.
> 
> Regards
> 
> Marcel
> 

  reply	other threads:[~2015-04-10 19:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-10 13:37 [PATCH 1/7] Bluetooth: btbcm: Add BCM4324B3 UART device Frederic Danis
2015-04-10 13:37 ` [PATCH 2/7] Bluetooth: hci_uart: Add HCIUARTSETBAUDRATE ioctl Frederic Danis
2015-04-10 15:24   ` Peter Hurley
2015-04-10 18:20     ` Marcel Holtmann
2015-04-10 19:05       ` Peter Hurley [this message]
2015-04-29 15:06       ` Frederic Danis
2015-04-10 13:37 ` [PATCH 3/7] Bluetooth: hci_uart: Support final speed during setup Frederic Danis
2015-04-10 19:05   ` Marcel Holtmann
2015-04-10 13:37 ` [PATCH 4/7] Bluetooth: btbcm: Split setup() function Frederic Danis
2015-04-10 20:12   ` Marcel Holtmann
2015-04-10 13:37 ` [PATCH 5/7] Bluetooth: btusb: Use btbcm_setup_post() Frederic Danis
2015-04-10 13:37 ` [PATCH 6/7] Bluetooth: hci_uart: " Frederic Danis
2015-04-10 13:37 ` [PATCH 7/7] Bluetooth: btbcm: Add bcm_set_baudrate() Frederic Danis
2015-04-10 20:19   ` Marcel Holtmann
2015-04-10 21:44     ` Peter Hurley
2015-04-10 21:57       ` Marcel Holtmann
2015-04-29 14:30     ` Frederic Danis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55281F06.7020104@hurleysoftware.com \
    --to=peter@hurleysoftware.com \
    --cc=frederic.danis@linux.intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).