public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* HCI_Reset and Notification to User-Space
@ 2008-07-29 12:09 pavan_savoy
  2008-07-29 13:03 ` Ohad Ben-Cohen
  0 siblings, 1 reply; 5+ messages in thread
From: pavan_savoy @ 2008-07-29 12:09 UTC (permalink / raw)
  To: linux-bluetooth, marcel, maxk

Hi,

I am trying to understand the HCI_RESET procedure and the notification of new device to the user-space, in case of a UART Bluetooth device.

What I am trying to understand is, in what place of hciattach does the whole system, [through dbus] get to know the existance of the bt device and what call [from which module] does that notification go to the user-space.

Just a brief about the hciattach / notification to user-space and socket setup.


Thanks in advance.
Pavan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: HCI_Reset and Notification to User-Space
  2008-07-29 12:09 HCI_Reset and Notification to User-Space pavan_savoy
@ 2008-07-29 13:03 ` Ohad Ben-Cohen
  2008-07-29 13:40   ` pavan_savoy
  0 siblings, 1 reply; 5+ messages in thread
From: Ohad Ben-Cohen @ 2008-07-29 13:03 UTC (permalink / raw)
  To: pavan_savoy; +Cc: linux-bluetooth

Hi Pavan,

On Tue, Jul 29, 2008 at 3:09 PM,  <pavan_savoy@indiatimes.com> wrote:
> What I am trying to understand is, in what place of hciattach does the whole system, [through dbus] get to know the existance of the bt device and what call [from which module] does that notification go to the user-space.

When hciattach calls the HCIUARTSETPROTO ioctl, you get the following
trace in the kernel:
hci_uart_set_proto -> hci_uart_register_dev -> hci_register_dev -> hci_notify.

The last function notifies user space (hcid) about the new device.
Hciattach does not use dbus and does not directly communicate with hcid.

Regards,
Ohad.

>
> Just a brief about the hciattach / notification to user-space and socket setup.
>
>
> Thanks in advance.
> Pavan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: HCI_Reset and Notification to User-Space
  2008-07-29 13:03 ` Ohad Ben-Cohen
@ 2008-07-29 13:40   ` pavan_savoy
  2008-07-29 14:45     ` Ohad Ben-Cohen
       [not found]     ` <723119697.28261217339091256.JavaMail.root@mbv7.indiatimes.com>
  0 siblings, 2 replies; 5+ messages in thread
From: pavan_savoy @ 2008-07-29 13:40 UTC (permalink / raw)
  To: Ohad Ben-Cohen; +Cc: linux-bluetooth

Thank you,

Also hci_notify notifies a HCI_DEV_REG event thru' the notifier chain, what I couldnt get was, how does HCI-daemon wait on it.
(related to g_io_add_watch or something was my guess, but not sure..., or is it using the Stack-Internal Socket Events? which would require hci_dev_open to be called.)

I until now had thought notifier chains are used only for inter-kernel notifications. I guess I was wrong.

Please clarify.


----- Original Message -----
From: Ohad Ben-Cohen <ohad@bencohen.org>
To: pavan savoy <pavan_savoy@indiatimes.com>
Cc: linux-bluetooth@vger.kernel.org
Sent: Tue, 29 Jul 2008 18:33:20 +0530 (IST)
Subject: Re: HCI_Reset and Notification to User-Space

Hi Pavan,

On Tue, Jul 29, 2008 at 3:09 PM,  <pavan_savoy@indiatimes.com> wrote:
> What I am trying to understand is, in what place of hciattach does the whole system, [through dbus] get to know the existance of the bt device and what call [from which module] does that notification go to the user-space.

When hciattach calls the HCIUARTSETPROTO ioctl, you get the following
trace in the kernel:
hci_uart_set_proto -> hci_uart_register_dev -> hci_register_dev -> hci_notify.

The last function notifies user space (hcid) about the new device.
Hciattach does not use dbus and does not directly communicate with hcid.

Regards,
Ohad.

>
> Just a brief about the hciattach / notification to user-space and socket setup.
>
>
> Thanks in advance.
> Pavan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: HCI_Reset and Notification to User-Space
  2008-07-29 13:40   ` pavan_savoy
@ 2008-07-29 14:45     ` Ohad Ben-Cohen
       [not found]     ` <723119697.28261217339091256.JavaMail.root@mbv7.indiatimes.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Ohad Ben-Cohen @ 2008-07-29 14:45 UTC (permalink / raw)
  To: pavan_savoy; +Cc: linux-bluetooth

Pavan,

Please don't top-post.

On Tue, Jul 29, 2008 at 4:40 PM,  <pavan_savoy@indiatimes.com> wrote:
> Also hci_notify notifies a HCI_DEV_REG event thru' the notifier chain, what I couldnt get was, how does HCI-daemon wait on it.
> (related to g_io_add_watch or something was my guess, but not sure..., or is it using the Stack-Internal Socket Events? which would require hci_dev_open to be called.)
>
> I until now had thought notifier chains are used only for inter-kernel notifications. I guess I was wrong.

The notification IS sent to a kernel client - the hci_sock_dev_event
function. That function in turn sends the event to a user space via a
socket which was created and watched by hcid beforehand. Check out
hcid's main function for more details.

Regards,
Ohad.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: HCI_Reset and Notification to User-Space
       [not found]     ` <723119697.28261217339091256.JavaMail.root@mbv7.indiatimes.com>
@ 2008-07-29 14:45       ` Ohad Ben-Cohen
  0 siblings, 0 replies; 5+ messages in thread
From: Ohad Ben-Cohen @ 2008-07-29 14:45 UTC (permalink / raw)
  To: pavan_savoy; +Cc: linux-bluetooth

On Tue, Jul 29, 2008 at 4:44 PM,  <pavan_savoy@indiatimes.com> wrote:
> Also I couldnt trace the hci_init_req, which does the HCI_RESET, read_BD addr, local name..etc..
>
> Who calls it ?

hci_dev_open. indirectly, using __hci_request.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-07-29 14:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-29 12:09 HCI_Reset and Notification to User-Space pavan_savoy
2008-07-29 13:03 ` Ohad Ben-Cohen
2008-07-29 13:40   ` pavan_savoy
2008-07-29 14:45     ` Ohad Ben-Cohen
     [not found]     ` <723119697.28261217339091256.JavaMail.root@mbv7.indiatimes.com>
2008-07-29 14:45       ` Ohad Ben-Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox