linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: pavel@ucw.cz (Pavel Machek)
To: linux-arm-kernel@lists.infradead.org
Subject: __hci_cmd_sync() not suitable for nokia h4p
Date: Tue, 9 Dec 2014 21:13:28 +0100	[thread overview]
Message-ID: <20141209201328.GA18003@amd> (raw)
In-Reply-To: <304050AD-DB11-4A2B-A1F7-8B1BBB5F04F0@holtmann.org>

Hi!

> > Major problem with Nokia H4P driver was, that it uses custom functions
> > instead of __hci_cmd_sync().

>  the __hci_cmd_sync is for sending HCI commands and not low-level
> protocol transports like H:4 or similar. So you want to separate the
> actual transport of HCI from the firmware loading.

The TODO file says:

# > +
# > +     skb_queue_tail(&info->txq, fw_skb);
# > +     spin_lock_irqsave(&info->lock, flags);
# > +     hci_h4p_outb(info, UART_IER, hci_h4p_inb(info, UART_IER) |
# > +                     UART_IER_THRI);
# > +     spin_unlock_irqrestore(&info->lock, flags);
# > +}
# 
# and as I explained before, this crazy can not continue. Bluetooth drivers can provide a
# +hdev->setup callback for loading firmware and doing other setup details. You can just
# +bring up the HCI transport. We are providing __hci_cmd_sync for easy loading of the
# +firmware. Especially if the firmware just consists of HCI commands. Which is clearly the
# +case with the Nokia firmware files.

...so I take it you (and thus TODO) were wrong and __hci_cmd_sync is
not suitable after all?

But I don't understand what you want me to do at this point. I guess
skb_queue_tail+hci_h4p_outb should be moved to a helper function
(that's easy), and I already moved initialization to hci_setup().

nokia_core.c uses test_bit(HCI_RUNNING, &info->hdev->flags) to tell
between initialization and data traffic, but I guess that's fine?

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2014-12-09 20:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-09 19:02 __hci_cmd_sync() not suitable for nokia h4p Pavel Machek
2014-12-09 19:07 ` Marcel Holtmann
2014-12-09 20:13   ` Pavel Machek [this message]
2014-12-09 21:19     ` Marcel Holtmann
2014-12-10 13:15       ` Pavel Machek
2014-12-11 12:58         ` Marcel Holtmann
2014-12-11 22:13           ` Pavel Machek
2014-12-11 22:25             ` Marcel Holtmann
2014-12-12  9:51               ` Pavel Machek
2014-12-12 12:28                 ` Marcel Holtmann
2014-12-12  1:15             ` Sebastian Reichel
2014-12-12 12:14               ` Pavel Machek
2014-12-13 17:35                 ` Sebastian Reichel

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=20141209201328.GA18003@amd \
    --to=pavel@ucw.cz \
    --cc=linux-arm-kernel@lists.infradead.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).