Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1463593

Re: [RFC 5/7] Bluetooth: hci_nokia: Introduce new driver

From Sebastian Reichel <sre@kernel.org>
Newsgroups linux.kernel
Subject Re: [RFC 5/7] Bluetooth: hci_nokia: Introduce new driver
Date 2016-08-16 11:30 +0200
Message-ID <s6IR4-1hW-19@gated-at.bofh.it> (permalink)
References <s5xEl-2xg-3@gated-at.bofh.it> <s5xEm-2xg-29@gated-at.bofh.it> <s6GFz-8pe-1@gated-at.bofh.it> <s6HrX-fU-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi,

On Tue, Aug 16, 2016 at 09:52:17AM +0200, Pali Rohár wrote:
> > > +		case HCI_NOKIA_RADIO_PKT:
> > 
> > Are you sure you can ignore the RADIO_PKT commands. They are
> > used to set up the FM radio parts of the chip. They are standard
> > HCI commands (in the case of Broadcom at least). At minimum it
> > should be added a comment here that you are ignoring them on
> > purpose.
> > 
> > > +		case HCI_NOKIA_NEG_PKT:
> > > +		case HCI_NOKIA_ALIVE_PKT:
> > 
> > And here I would also a comment on why are we ignore these
> > commands and driving this all by ourselves.
> > 
> 
> Good question... In Pavel's version of bluetooth driver, which is
> working on Nokia N900, is sent whole firmware at one __hci_cmd_sync
> step. It does not skip any packets, plus he added this comment:
> 
> /* Note that this is timing-critical. If sending packets takes
>  * too long, initialization will fail.
>  */
> 
> So really, can we skip those packets? And is not this reason why
> this bluetooth driver does not work on Nokia N900?

Let's have a look - here is Pavel's version:
https://lwn.net/Articles/627201/

In pseudocode:

while(true) {
    cmd = get_cmd_from_firmware();
    if (!cmd) break;
    __hci_cmd_sync(cmd);
}

This is not "whole firmware at one __hci_cmd_sync step", is it?
And obviously that wouldn't work. Next let's have a look at
"It does not skip any packets":

/* Skip first two packets */
if (++num <= 2)
    continue;

Which are HCI_NOKIA_NEG_PKT and HCI_NOKIA_ALIVE_PKT. Those are
open-coded. By using the packets from the firmware we could drop the
negotiation/alive functions from the driver and remove quite a few
lines of code. I think it should only be done after finding the N900
bug, though. I found it quite useful, that first communication does not
happen through the firmware file.

Surely the radio packet is not ignored, but that part is not used on
N950 and N900 fails at first packet, so no way to test the radio
packet handling. I probably should add a /* TODO: check how to
handle radio packets */ for the radio packet entry. Or implement it
the way Marcel suggested and hope that it just works once the other
bug is found.

-- Sebastian

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC 0/7] Nokia N9xx bluetooth driver Sebastian Reichel <sre@kernel.org> - 2016-08-13 05:20 +0200
  [RFC 1/7] tty: serial: omap: add UPF_BOOT_AUTOCONF flag for DT init Sebastian Reichel <sre@kernel.org> - 2016-08-13 05:20 +0200
    Re: [RFC 1/7] tty: serial: omap: add UPF_BOOT_AUTOCONF flag for DT  init Pavel Machek <pavel@ucw.cz> - 2016-08-14 11:00 +0200
      Re: [RFC 1/7] tty: serial: omap: add UPF_BOOT_AUTOCONF flag for DT  init Sebastian Reichel <sre@kernel.org> - 2016-08-16 10:20 +0200
  [RFC 5/7] Bluetooth: hci_nokia: Introduce new driver Sebastian Reichel <sre@kernel.org> - 2016-08-13 05:20 +0200
    Re: [RFC 5/7] Bluetooth: hci_nokia: Introduce new driver Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-08-15 02:00 +0200
      Re: [RFC 5/7] Bluetooth: hci_nokia: Introduce new driver Sebastian Reichel <sre@kernel.org> - 2016-08-15 03:20 +0200
    Re: [RFC 5/7] Bluetooth: hci_nokia: Introduce new driver Marcel Holtmann <marcel@holtmann.org> - 2016-08-16 09:10 +0200
      Re: [RFC 5/7] Bluetooth: hci_nokia: Introduce new driver Pali Rohár <pali.rohar@gmail.com> - 2016-08-16 10:00 +0200
        Re: [RFC 5/7] Bluetooth: hci_nokia: Introduce new driver Sebastian Reichel <sre@kernel.org> - 2016-08-16 11:30 +0200
      Re: [RFC 5/7] Bluetooth: hci_nokia: Introduce new driver Sebastian Reichel <sre@kernel.org> - 2016-08-16 11:20 +0200
        Re: [RFC 5/7] Bluetooth: hci_nokia: Introduce new driver Marcel Holtmann <marcel@holtmann.org> - 2016-08-16 12:30 +0200
        Re: [RFC 5/7] Bluetooth: hci_nokia: Introduce new driver Marcel Holtmann <marcel@holtmann.org> - 2016-08-16 12:30 +0200
          Re: [RFC 5/7] Bluetooth: hci_nokia: Introduce new driver Pavel Machek <pavel@ucw.cz> - 2016-08-16 22:10 +0200
    Re: [RFC 5/7] Bluetooth: hci_nokia: Introduce new driver Marcel Holtmann <marcel@holtmann.org> - 2016-08-16 10:20 +0200
      Re: [RFC 5/7] Bluetooth: hci_nokia: Introduce new driver Sebastian Reichel <sre@kernel.org> - 2016-08-16 11:40 +0200
  Re: [RFC 0/7] Nokia N9xx bluetooth driver Marcel Holtmann <marcel@holtmann.org> - 2016-08-16 09:20 +0200
    Re: [RFC 0/7] Nokia N9xx bluetooth driver Rob Herring <robh+dt@kernel.org> - 2016-08-16 22:30 +0200

csiph-web