Linux bluetooth development
 help / color / mirror / Atom feed
* [Bluez-devel] hci_request
@ 2005-04-23 22:44 Oliver
  2005-04-26 11:50 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver @ 2005-04-23 22:44 UTC (permalink / raw)
  To: bluez-devel

Hi all in list

Well I am trying to understand the full blueZ Stack,
and i stopped in in hci_core.c the function " __hci_request(...) " line 121

In this portion of code

#####
	DECLARE_WAITQUEUE(wait, current);
	int err = 0;

	BT_DBG("%s start", hdev->name);

	hdev->req_status = HCI_REQ_PEND;

	add_wait_queue(&hdev->req_wait_q, &wait);
	set_current_state(TASK_INTERRUPTIBLE);

	req(hdev, opt);
	schedule_timeout(timeout);

	remove_wait_queue(&hdev->req_wait_q, &wait);

	if (signal_pending(current))
		return -EINTR;
######

So:

The task who calls the hci_request keeps blocked in add_wait_queue(..) call.
Which is unblocked by the hci_req_complete() call which is calling when 
processing an event.

After unblocking req() call proceeds and awaits at least the timeout 
specified schedule_timeout() ... after that the tast is removed form the 
device queue.

Is my mind as mixed as i think? am i right? did i understand it well?

Then what is checking signal_pending(current) call ? 

Thanks in advance, and begging for corrections

Oliver




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] hci_request
  2005-04-23 22:44 [Bluez-devel] hci_request Oliver
@ 2005-04-26 11:50 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2005-04-26 11:50 UTC (permalink / raw)
  To: bluez-devel

Hi Oliver,

do you really think that reposting the same email makes it more likely
that you get an answer. Please read this first:

http://www.catb.org/~esr/faqs/smart-questions.html

> Well I am trying to understand the full blueZ Stack,
> and i stopped in in hci_core.c the function " __hci_request(...) " line 121
> 
> In this portion of code
> 
> #####
> 	DECLARE_WAITQUEUE(wait, current);
> 	int err = 0;
> 
> 	BT_DBG("%s start", hdev->name);
> 
> 	hdev->req_status = HCI_REQ_PEND;
> 
> 	add_wait_queue(&hdev->req_wait_q, &wait);
> 	set_current_state(TASK_INTERRUPTIBLE);
> 
> 	req(hdev, opt);
> 	schedule_timeout(timeout);
> 
> 	remove_wait_queue(&hdev->req_wait_q, &wait);
> 
> 	if (signal_pending(current))
> 		return -EINTR;
> ######
> 
> So:

The book Linux Device Drivers would be a good thing to read first.

> The task who calls the hci_request keeps blocked in add_wait_queue(..) call.
> Which is unblocked by the hci_req_complete() call which is calling when 
> processing an event.

Who said that? This is not blocking.

> After unblocking req() call proceeds and awaits at least the timeout 
> specified schedule_timeout() ... after that the tast is removed form the 
> device queue.

The req() is also not blocking. Only schedule_timeout() is blocking
until hci_req_complete().

> Then what is checking signal_pending(current) call ? 

It checks for pending signals.

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

end of thread, other threads:[~2005-04-26 11:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-23 22:44 [Bluez-devel] hci_request Oliver
2005-04-26 11:50 ` Marcel Holtmann

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