免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 878 | 回复: 0
打印 上一主题 下一主题

Dm9000 驱动心得 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-06-23 19:13 |只看该作者 |倒序浏览

               

  Normal
  0
  
  7.8 磅
  0
  2
  
  false
  false
  false
  
   
   
   
   
   
   
   
   
   
   
   
   
  
  MicrosoftInternetExplorer4



st1\:*{behavior:url(#ieooui) }
/* Style Definitions */
table.MsoNormalTable
        {mso-style-name:普通表格;
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";
        mso-ansi-language:#0400;
        mso-fareast-language:#0400;
        mso-bidi-language:#0400;}

1、冷静的编写代码,不管是驱动还是app,不为外物所动,心中只有代码。
2、了解Linux Kernel各部分工作方式,减少所开发程序的常识性错误。
3、获取所需驱动设备的基本知识,保证开发的正确性。
4、详细阅读分析datasheet会在一定程度上降低开发前期速度,但是却会加速后期的开发速度。
5、合理使用调试等级制度可以对输出进行更详细的设置,在调试时能更方便的得到需要的调试信息。例如:
#define DM9000_DEBUG 0

#if DM9000_DEBUG > 1
#define PRINTK2(args...)  printk(“DM9000” ": " args)
#else
#define PRINTK2(args...)  do { } while(0)
#endif

#if DM9000_DEBUG > 0
#define PRINTK1(args...)  printk(“DM9000” ": " args)
#define PRINTK(args...)   printk(“DM9000” ": " args)
#else
#define PRINTK1(args...)  do { } while(0)
#define PRINTK(args...)   printk(KERN_DEBUG args)
#endif
6、使用指针会带来一定麻烦,但是驾驭良好的指针会给程序良好运行提供最基础的保障。
7、一定要选择合适的锁机制。以及锁的范围。
8、Oops和printk获得的信息需要仔细分析,这样可以避免很多重复的操作:编译,传输驱动程序,加载驱动程序,出错……
9、不要奢望正确代码出现的偶然性,要保证你知道缩写的每一行代码的用途。

  Normal
  0
  
  7.8 磅
  0
  2
  
  false
  false
  false
  
   
   
   
   
   
   
   
   
   
   
   
   
  
  MicrosoftInternetExplorer4



/* Style Definitions */
table.MsoNormalTable
        {mso-style-name:普通表格;
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";
        mso-ansi-language:#0400;
        mso-fareast-language:#0400;
        mso-bidi-language:#0400;}
10、正确退出minicom,否则,你会后悔的。当然,也可以用ps –aux | grep minicom,来查到minicom的id,并干掉他。
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/44250/showart_1974947.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP