/usr/share/doc/HOWTO/ja-html/PCMCIA-PROG-5.html is in doc-linux-ja-html 2006.05.25-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>Linux PCMCIA ¥×¥í¥°¥é¥Þ¤Î¼ê°ú¤: ¥«¡¼¥É¥µ¡¼¥Ó¥¹¥¤¥Ù¥ó¥È¤Î°·¤¤¤Ë¤Ä¤¤¤Æ</TITLE>
<LINK HREF="PCMCIA-PROG-6.html" REL=next>
<LINK HREF="PCMCIA-PROG-4.html" REL=previous>
<LINK HREF="PCMCIA-PROG.html#toc5" REL=contents>
</HEAD>
<BODY>
<A HREF="PCMCIA-PROG-6.html">¼¡¤Î¥Ú¡¼¥¸</A>
<A HREF="PCMCIA-PROG-4.html">Á°¤Î¥Ú¡¼¥¸</A>
<A HREF="PCMCIA-PROG.html#toc5">Ìܼ¡¤Ø</A>
<HR>
<H2><A NAME="s5">5. ¥«¡¼¥É¥µ¡¼¥Ó¥¹¥¤¥Ù¥ó¥È¤Î°·¤¤¤Ë¤Ä¤¤¤Æ</A></H2>
<P>¥«¡¼¥É¥µ¡¼¥Ó¥¹¥¤¥Ù¥ó¥È¤Ï¤¤¤¯¤Ä¤«¤Î¾ðÊ󸻤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£:
<P>
<UL>
<LI>¥«¡¼¥É¤Î¾õÂÖÊѹ¹¤¬²¼°Ì¤Î¥½¥±¥Ã¥È¥É¥é¥¤¥Ð¤«¤éÊó¹ð¤µ¤ì¤Þ¤·¤¿¡£</LI>
<LI>¥«¡¼¥É¥µ¡¼¥Ó¥¹¼«¿È¤¬¿Í°ÙŪ¤Ê¥¤¥Ù¥ó¥È¤òȯÀ¸¤µ¤»¤Þ¤·¤¿¡£</LI>
<LI>¥¢¥É¥Ð¥ó¥¹¥É¥Ñ¥ï¡¼¥Þ¥Í¡¼¥¸¥á¥ó¥È(APM) ¤Î¥¤¥Ù¥ó¥È¡£</LI>
<LI>¤½¤Î¾¤Î¥«¡¼¥É¥µ¡¼¥Ó¥¹¥¯¥é¥¤¥¢¥ó¥È¤¬È¯À¸¤µ¤»¤¿¥¤¥Ù¥ó¥È¡£</LI>
</UL>
<P>¥½¥±¥Ã¥È¥É¥é¥¤¥Ð¤Î¥¤¥Ù¥ó¥È¤Ï³ä¤ê¹þ¤ß¶îÆ°¤Þ¤¿¤Ï¥Ý¡¼¥ê¥ó¥°¤Î¤É¤Á¤é¤«
¤È¤Ê¤ê¤Þ¤¹¡£
<P>
<P>
<H2><A NAME="ss5.1">5.1 ¥¤¥Ù¥ó¥È¥Ï¥ó¥É¥é¤ÎÁàºî</A>
</H2>
<P>¥«¡¼¥É¥µ¡¼¥Ó¥¹¤¬¥¤¥Ù¥ó¥È¤¬È¯À¸¤·¤¿»ö¤òǧ¼±¤·¤¿»þ¤Ë¡¢¤½¤ì¤¾¤ì¤Î
¥¯¥é¥¤¥¢¥ó¥È¤¬¥¤¥Ù¥ó¥ÈÄÌÃΤò¼õ¤±¤¿¤«¥¤¥Ù¥ó¥È¥Þ¥¹¥¯¤òÄ´ºº¤·¤Þ¤¹¡£
¥«¡¼¥É¥µ¡¼¥Ó¥¹¤Ë¥¯¥é¥¤¥¢¥ó¥È¤«ÅÐÏ¿¤µ¤ì¤¿»þ¡¢¥¤¥Ù¥ó¥È¥Ï¥ó¥É¥é¤Î
²ó¼ý(callback)´Ø¿ô¤ò»ØÄꤷ¤Þ¤¹¡£¤³¤Î¥Ï¥ó¥É¥é¤Ï¼¡¤ÎÍͼ°¤ò¤·¤Æ¤¤¤Þ¤¹¡£:
<P>
<BLOCKQUOTE><CODE>
<PRE>
int (*event_handler)(event_t event, int priority, event_callback_args_t *args);
</PRE>
</CODE></BLOCKQUOTE>
<P><CODE>priority</CODE> ÊÑ¿ô¤ÏÄ̾ï¤Î¥¤¥Ù¥ó¥ÈÍѤΠ<CODE>CS_EVENT_PRI_LOW</CODE> ¤«
¨»þ±þÅúÍ×µá¤Î¥¤¥Ù¥ó¥ÈÍѤΠ<CODE>CS_EVENT_PRI_HIGH</CODE> ¤Ê¤Î¤«¤òÀßÄꤷ¤Þ
¤¹¡£¹âÍ¥Àè½ç°Ì¤Î¥¤¥Ù¥ó¥È¤Î¤ß <CODE>CS_EVENT_CARD_REMOVAL</CODE> ¤òÀßÄꤷ¤Þ
¤¹¡£¥¯¥é¥¤¥¢¥ó¥È¥¤¥Ù¥ó¥È¥Ï¥ó¥É¥é¤Ï¤³¤Î¹âÍ¥Àè½ç°Ì¤Î¥¤¥Ù¥ó¥È¤òÆäË
½ÐÍè¤ë¤À¤±Â®¤¯¥«¡¼¥É¥µ¡¼¥Ó¥¹¤¬Â¾¤Î¥¯¥é¥¤¥¢¥ó¥È¤ËÄÌÃνÐÍè¤ë¤è¤¦¤Ë½èÍý
¤·¤Þ¤¹¡£
<P><CODE>event_callback_args_t </CODE>¹½Â¤ÂΤÎÄêµÁ¤Ï¼¡¤Î¤È¤ª¤ê:
<BLOCKQUOTE><CODE>
<PRE>
typedef struct event_callback_args_t {
client_handle_t client_handle;
void *info;
void *mtdrequest;
void *buffer;
void *misc;
void *client_data;
} event_callback_args_t;
</PRE>
</CODE></BLOCKQUOTE>
<P><CODE>client_handle</CODE> ¥á¥ó¥Ð¤Ï¥¤¥Ù¥ó¥È¤ËÂбþ¤¹¤ë¥½¥±¥Ã¥È¤Î¥¯¥é¥¤¥¢¥ó¥È¤Î
¥Ï¥ó¥É¥é¤òÀßÄꤷ¤Þ¤¹¡£¤³¤ÎÊýË¡¤Ï¥É¥é¥¤¥Ð¤¬¤¤¤¯¤Ä¤«¤Î¥½¥±¥Ã¥È¤È·ë¹ç¤·
¤Æ¤¤¤ë¾ì¹ç¤ËͱפǤ¹¡£<CODE>info</CODE> ÊÑ¿ô¤Ï¸½¾õ¤Ç¤Ï <CODE>ResetCard</CODE> ¤ØÅϤ¹¸Æ½Ð¤·¤Î
½ªÎ»¾õÂÖ¤òÊÖ¤¹¤Î¤Ë»È¤ï¤ì¤ë¤À¤±¤Ç¤¹¡£<CODE>client_data</CODE> ÊÑ¿ô¤Ï³ºÅö¤¹¤ë¥Ç¥Ð¥¤¥¹
¤È´ØÏ¢¤¹¤ë¥í¡¼¥«¥ë¤Ê¥Ç¡¼¥¿¹½Â¤ÂΤò»Ø¤¹¤Î¤Ë¥É¥é¥¤¥Ð¤¬»È¤¤¤Þ¤¹¡£
¾¤ÎÊÑ¿ô¤Ï»È¤ï¤ì¤Æ¤¤¤Þ¤»¤ó¡£
<P>
<H2><A NAME="ss5.2">5.2 ¥¤¥Ù¥ó¥È¤ÎÀâÌÀ</A>
</H2>
<P>
<P>
<DL>
<DT><B><CODE>CS_EVENT_CARD_INSERTION</CODE></B><DD><P>¥«¡¼¥É¤¬ÁÞÆþ¤µ¤ì¤¿»ö¤òɽ¤¹¥¤¥Ù¥ó¥È¿®¹æ¡£¥É¥é¥¤¥Ð¤¬»ÈÍÑÃæ¤Î
¥½¥±¥Ã¥È¤Ë·ë¹ç¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥«¡¼¥É¥µ¡¼¥Ó¥¹¤Ï¥É¥é¥¤¥Ð¤Ë¿Í°Ù
Ū¤ËÁÞÆþ¥¤¥Ù¥ó¥È¤òÁ÷½Ð¤·¤Þ¤¹¡£
<DT><B><CODE>CS_EVENT_CARD_REMOVAL</CODE></B><DD><P>¥«¡¼¥É¤¬È´¤«¤ì¤¿»ö¤òɽ¤¹¥¤¥Ù¥ó¥È¿®¹æ¡£¤³¤Î¥¤¥Ù¥ó¥È¤Ï¥«¡¼¥É¥µ¡¼¥Ó¥¹
¤¬Á´¤Æ¤Î¥¯¥é¥¤¥¢¥ó¥È¤Ë²Äǽ¤Ê¸Â¤ê®¤¯ÄÌÃΤ¹¤ë°Ù¤ËºÇ¾®¤ÎÃÙ±ä»þ´Ö
¤Ç¼è¤ê°·¤¤¤Þ¤¹¡£
<DT><B><CODE>CS_EVENT_BATTERY_LOW</CODE></B><DD><P>``ÅÅÃÓÉÔÂ''¾õÂÖ¤ËÊѲ½¤·¤¿»ö¤òɽ¤¹¥¤¥Ù¥ó¥È¿®¹æ¡£
<DT><B><CODE>CS_EVENT_BATTERY_DEAD</CODE></B><DD><P>``ÅÅÃÓÀÚ¤ì''¾õÂÖ¤ËÊѲ½¤·¤¿»ö¤òɽ¤¹¥¤¥Ù¥ó¥È¿®¹æ¡£
<DT><B><CODE>CS_EVENT_READY_CHANGE</CODE></B><DD><P>``½àÈ÷´°Î»''¾õÂÖ¤ËÊѲ½¤·¤¿»ö¤òɽ¤¹¥¤¥Ù¥ó¥È¿®¹æ¡£
<DT><B><CODE>CS_EVENT_WRITE_PROTECT</CODE></B><DD><P>``½ñ¤¹þ¤ß¶Ø»ß''¾õÂÖ¤ËÊѲ½¤·¤¿»ö¤òɽ¤¹¥¤¥Ù¥ó¥È¿®¹æ¡£
<DT><B><CODE>CS_EVENT_REGISTRATION_COMPLETE</CODE></B><DD><P><CODE>RegisterClient</CODE> ¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤¿¸å¤Ë¥É¥é¥¤¥Ð¤ËÁ÷¤ë¥¤¥Ù¥ó¥È¡£
<DT><B><CODE>CS_EVENT_RESET_REQUEST</CODE></B><DD><P>¥¯¥é¥¤¥¢¥ó¥È¤¬ <CODE>ResetCard</CODE> ¤ò¸Æ¤ó¤À»þ¤ËÁ÷¤ë¥¤¥Ù¥ó¥È¡£¥¤¥Ù¥ó¥È
¥Ï¥ó¥É¥é¤Ï¸Æ¤Ó½Ð¤·¤¬¼ºÇÔ¤·¤¿¤é¥ê¥»¥Ã¥ÈÁàºî¤òµñÈݤǤ¤Þ¤¹¡£
<DT><B><CODE>CS_EVENT_RESET_PHYSICAL</CODE></B><DD><P>¥ê¥»¥Ã¥È¿®¹æ¤ò¥«¡¼¥É¤ËÁ÷¤ëľÁ°¤ËÁ´¤Æ¤Î¥¯¥é¥¤¥¢¥ó¥È¤ËÁ÷¤ê¤Þ¤¹¡£
<DT><B><CODE>CS_EVENT_CARD_RESET</CODE></B><DD><P>¥ê¥»¥Ã¥ÈÁàºî¤¬½ªÎ»¤·¤¿¤éÁ÷¤ë¥¤¥Ù¥ó¥È¿®¹æ¡£¥ê¥»¥Ã¥È¤¬À®¸ù¤·¤¿¤«
¼ºÇÔ¤·¤¿¤«¤Ï <CODE>GetStatus</CODE> ¤ò»ÈÍѤ·¤Æǧ¼±¤·¤Þ¤¹¡£
<DT><B><CODE>CS_EVENT_RESET_COMPLETE</CODE></B><DD><P><CODE>ResetCard</CODE> ¤ò¸Æ¤ó¤Ç¥ê¥»¥Ã¥È½èÍý¤Î´°Î»¤·¤¿¤³¤È¤ò¥¯¥é¥¤¥¢¥ó¥È¤Ë
ÄÌÃΤ¹¤ë¥¤¥Ù¥ó¥È¡£
<DT><B><CODE>CS_EVENT_PM_SUSPEND</CODE></B><DD><P>¥«¡¼¥É¥µ¡¼¥Ó¥¹¤¬¥æ¡¼¥¶¤Î½é´ü²½¤Þ¤¿¤Ï APM ¥µ¥¹¥Ú¥ó¥ÉÍ×µá¤ò¼õ¤±
¼è¤Ã¤¿»ö¤òɽ¤¹¥¤¥Ù¥ó¥È¿®¹æ¡£¥¤¥Ù¥ó¥È¥Ï¥ó¥É¥é¤Ï¸Æ¤Ó½Ð¤·¤¬¼ºÇÔ
¤·¤¿¤é¥µ¥¹¥Ú¥ó¥É¤òµñÈݤǤ¤Þ¤¹¡£
<DT><B><CODE>CS_EVENT_PM_RESUME</CODE></B><DD><P>¥µ¥¹¥Ú¥ó¥É/¥ê¥¸¥å¡¼¥àÌ¿Îá¤Î¸å¤Ç¥·¥¹¥Æ¥à¤¬Ää»ß¤·¤¿¤³¤È¤òɽ¤¹¿®¹æ¡£
<DT><B><CODE>CS_EVENT_MTD_REQUEST</CODE></B><DD><P>MTD ¥á¥â¥êÁàºî¤Î½é´ü²½¤Ë»È¤¤¤Þ¤¹¡£Í×µá¤Î¼ïÎà¤Ï <CODE>callback</CODE> °ú¿ô¤Î
<CODE>mtdrequest</CODE> ÊÑ¿ô¤ÎÃæ¤ËÅϤµ¤ì¤Þ¤¹¡£¥Û¥¹¥È¤Î¥Ð¥Ã¥Õ¥¡¥¢¥É¥ì¥¹¤Ï
<CODE>buffer</CODE> ÊÑ¿ô¤ËÅϤµ¤ì¤Þ¤¹¡£
<DT><B><CODE>CS_EVENT_ERASE_COMPLETE</CODE></B><DD><P>¥¥å¡¼¤ËÆþ¤ì¤¿¾ÃµîÁàºî¤¬½ªÎ»¤·¤¿»ö¤ò¥¯¥é¥¤¥¢¥ó¥È¤ËÄÌÃΤ¹¤ë¤Î¤Ë
»ÈÍѤ·¤Þ¤¹¡£¾Ãµî¥¥å¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ï <CODE>callback</CODE> °ú¿ô¤Î <CODE>info</CODE>
ÊÑ¿ô¤ËÊÖ¤ê¤Þ¤¹¡£
</DL>
<P>
<P>
<H2><A NAME="ss5.3">5.3 ¥¯¥é¥¤¥¢¥ó¥È¥É¥é¥¤¥Ð¤Î¥¤¥Ù¥ó¥ÈÁàºî¤ÎÌò³ä¤Ë¤Ä¤¤¤Æ</A>
</H2>
<P>¥¯¥é¥¤¥¢¥ó¥È¥É¥é¥¤¥Ð¤Ï¥½¥±¥Ã¥È¤¬ÀßÄꤵ¤ì¤¿¤«²ò½ü¤µ¤ì¤¿¤«¤Ë¤è¤Ã¤Æ
ȯÀ¸¤¹¤ë <CODE>CS_EVENT_CARD_INSERTION</CODE> ¥¤¥Ù¥ó¥È¤È <CODE>CS_EVENT_CARD_REMOVAL</CODE>
¥¤¥Ù¥ó¥È¤Ë±þÅú¤·¤Þ¤¹¡£½¾¤Ã¤Æ¥«¡¼¥É¤Î½üµî¤Ï¹â¤¤Í¥ÀèÅ٤Υ¤¥Ù¥ó¥È¤Ê¤Î¤Ç
¥É¥é¥¤¥Ð¤Ï¨»þ¤Ë¥½¥±¥Ã¥È¤È¤ÎÆþ½ÐÎϤò¼×ÃǤ·¡¢device ¹½Â¤ÂΤ˥ե饰¤ò
ÀßÄꤷ¡¢¤½¤Î¾Á´¤Æ¤Î½èÍý¤ò¸å¤ÇȯÀ¸¤¹¤ë»þ´Ö³ä¤ê¹þ¤ß¤ò»ÈÍѤ·¤ÆÃæ»ß¤¹¤ë
¤è¤¦¤ËͽÄê¤ËÁȤ߹þ¤ß¤Þ¤¹¡£
<P><CODE>CS_EVENT_PM_RESET_REQUEST</CODE> ¥¤¥Ù¥ó¥È¤ò¼õ¤±¼è¤Ã¤¿»þ¤Ï¡¢¥É¥é¥¤¥Ð¤Ï
Æþ½ÐÎϤò¼×ÃǤ·¥í¥Ã¥¯¤·¤¿¥½¥±¥Ã¥È¤ÎÀßÄê¤ò²òÊü¤·¡¢¥É¥é¥¤¥Ð¤Ï¥½¥±¥Ã¥È¤Î
ÀßÄê¤È¼×ÃÇÁ°¤ÎÆþ½ÐÎϤò³ÊǼ¤·¤Þ¤¹¡£<CODE>CS_EVENT_CARD_RESET</CODE> ¤ò¼õ¤±¼è¤Ã¤¿
»þ¤Ï¡¢¥É¥é¥¤¥Ð¹½À®¤ò³ÊǼ¤·Æþ½ÐÎϤÎÉõº¿¤ò²ò¤¤Þ¤¹¡£
<P>Æþ½ÐÎϤ¬¼×ÃǤµ¤ì¤«¤Ä¥½¥±¥Ã¥È¤Î¹½À®¤¬²òÊü¤µ¤ì¤¿¾ì¹ç¤Ë <CODE>CS_EVENT_PM_SUSPEND</CODE>
¥¤¥Ù¥ó¥È¤ÏÂçÂÎ <CODE>CS_EVENT_PM_RESET_REQUEST</CODE> ¥¤¥Ù¥ó¥È¤Î¤è¤¦¤Ë°·¤ï¤ì¤Þ¤¹¡£
<CODE>CS_EVENT_PM_RESUME</CODE> ¥¤¥Ù¥ó¥È¤ò¼õ¤±¼è¤Ã¤¿»þ¤Ï¥É¥é¥¤¥Ð¤¬¥«¡¼¥É¤ÎºÆÀßÄê¤Î
½àÈ÷¤¬½ÐÍè¤Æ¤¤¤ë¾ì¹ç¤ò½ü¤¤¤Æ¡¢<CODE>CS_EVENT_CARD_RESET</CODE> ¥¤¥Ù¥ó¥È¤ò¼õ¤±¼è¤Ã¤¿
»þ¤ÈƱÍͤǤ¹¡£
<P>
<P>
<HR>
<A HREF="PCMCIA-PROG-6.html">¼¡¤Î¥Ú¡¼¥¸</A>
<A HREF="PCMCIA-PROG-4.html">Á°¤Î¥Ú¡¼¥¸</A>
<A HREF="PCMCIA-PROG.html#toc5">Ìܼ¡¤Ø</A>
</BODY>
</HTML>
|