LinuxÖеȴý¶ÓÁлúÖÆ·ÖÎö
LinuxÖеȴý¶ÓÁлúÖÆ·ÖÎö
ʲôÊǵȴý¶ÓÁУ¿
ÔÚÈí¼þ¿ª·¢ÖÐÈÎÎñ¾³£ÓÉÓÚijÖÖÌõ¼þûÓеõ½Âú×ã¶ø²»µÃ²»½øÈë˯Ãß״̬£¬È»ºóµÈ´ýÌõ¼þµÃµ½Âú×ãµÄʱºòÔÙ¼ÌÐøÔËÐУ¬½øÈëÔËÐÐ״̬¡£ÕâÖÖÐèÇóÐèÒªµÈ´ý¶ÓÁлúÖƵÄÖ§³Ö¡£LinuxÖÐÌṩÁ˵ȴý¶ÓÁеĻúÖÆ£¬¸Ã»úÖÆÔÚÄÚºËÖÐÓ¦Óúܹ㷺¡£
ÔÚLinuxÄÚºËÖÐʹÓõȴý¶ÓÁеĹý³ÌºÜ¼òµ¥£¬Ê×Ïȶ¨ÒåÒ»¸öwait_queue_head£¬È»ºóÈç¹ûÒ»¸ötaskÏëµÈ´ýijÖÖʼþ£¬ÄÇôµ÷ÓÃwait_event£¨µÈ´ý¶ÓÁУ¬Ê¼þ£©¾Í¿ÉÒÔÁË¡£
LinuxÖеȴý¶ÓÁеÄʵÏÖ
µÈ´ý¶ÓÁÐÓ¦Óù㷺£¬µ«ÊÇÄÚºËʵÏÖÈ´Ê®·Ö¼òµ¥¡£ÆäÉæ¼°µ½Á½¸ö±È½ÏÖØÒªµÄÊý¾Ý½á¹¹£º
<!--[if !supportLists]-->1) <!--[endif]-->__wait_queue_head£¬¸Ã½á¹¹ÃèÊöÁ˵ȴý¶ÓÁеÄÁ´Í·£¬Æä°üº¬Ò»¸öÁ´±íºÍÒ»¸öÔ×ÓËø£¬½á¹¹¶¨ÒåÈçÏ£º
struct __wait_queue_head {
spinlock_t lock; /* ±£»¤µÈ´ý¶ÓÁеÄÔ×ÓËø */
struct list_head task_list; /* µÈ´ý¶ÓÁÐ */
};
<!--[if !supportLists]-->2) <!--[endif]-->__wait_queue£¬¸Ã½á¹¹ÊǶÔÒ»¸öµÈ´ýÈÎÎñµÄ³éÏó¡£Ã¿¸öµÈ´ýÈÎÎñ¶¼»á³éÏó³ÉÒ»¸öwait_queue£¬²¢ÇÒ¹ÒÔص½wait_queue_headÉÏ¡£¸Ã½á¹¹¶¨ÒåÈçÏ£º
struct __wait_queue {
unsigned int flags;
void *private; /* ͨ³£Ö¸Ïòµ±Ç°ÈÎÎñ¿ØÖÆ¿é */
/* ÈÎÎñ»½ÐѲÙ×÷·½·¨£¬¸Ã·½·¨ÔÚÄÚºËÖÐÌṩ£¬Í¨³£Îªautoremove_wake_function */
wait_queue_func_t func; &nb
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈÐÒé ......
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
´ÓLinux 2.6ÆðÒýÈëÁËÒ»Ì×еÄÇý¶¯¹ÜÀíºÍ×¢²á»úÖÆ:Platform_deviceºÍPlatform_driver¡£
LinuxÖд󲿷ֵÄÉ豸Çý¶¯£¬¶¼¿ÉÒÔʹÓÃÕâÌ×»úÖÆ, É豸ÓÃPlatform_device±íʾ£¬Çý¶¯ÓÃPlatform_driver½øÐÐ×¢²á¡£
Linux platform driver»úÖƺʹ«Í³µÄdevice driver »úÖÆ(ͨ¹ýdriver_registerº¯Êý½øÐÐ×¢²á)Ïà±È£¬Ò»¸öÊ® ......
֮ǰ¿´ÁËһЩ¹ØÓÚlinux²Ù×÷ϵͳµÄ½Ì³Ì£¬±È½Ïϲ»¶½«ÕâЩ¶«Î÷¼Ç¼ÔÚ±¾×ÓÉÏ£¬ÏÖÔÚÔÙ½«ÕâЩ¶«Î÷Ìùµ½²©¿ÍÉÏ£¬ºÍ´ó¼Ò½»Á÷һϡ£ºÜ¶àlinux¸ßÊÖ˵µ½£¬ÏëҪѧºÃlinux±ØÐë¶ÔÆäĿ¼Óиö͸³¹µÄÀí½â¡£ÒÔÏÂÊÇÎÒ×ܽáµÄһЩ¶«Î÷:
ÓëWindowsÒ»Ñù£¬ÔÚLinuxÖÐÒ²ÊÇͨ¹ýĿ¼À´×éÖ¯ÎļþµÄ¡£µ«²»Í¬µÄÊÇ£¬ÔÚLinuxÏÂÖ»ÓÐÒ»¸ö¸ùĿ¼£¬¶ø²»ÏóWin ......