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

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