Dear Sir:
     I try recv1000.c(http://www.cs.usfca.edu/~cruse/cs635/recv1000.c)
 kernel module in VMware WorkStation 6(because I have no money to buy
 intel nic), which simulates a nic Intel 82545EM-A.
     I modified the source code, try to make the code working in
 vmware. But I failed:-(

 I just modified DEVICE_ID and used dyn major in register_chrdev.
 Logs:
 e1000: eth0: e1000_clean_tx_irq: Detected Tx Unit Hang
 Tx Queue             <0>
 TDH                  <0>
 TDT                  <2>
 next_to_use          <2>
 next_to_clean        <0>
 buffer_info[next_to_clean]
 time_stamp           <1dff8>
 next_to_watch        <0>
 jiffies              <1e125>
 next_to_watch.status <0>

 Now , I don't know the problem is about my code or vmware.
 Hope for your reply!

 This is the patch:
 --- recv1000.c  2008-07-22 17:25:42.000000000 +0800
 +++ recv1000-mod.c      2008-07-22 17:26:16.000000000 +0800
 @@ -27,9 +27,11 @@
 #include <linux/interrupt.h>   // for request_irq()
 #include <asm/uaccess.h>       // for copy_to_user()
 #include <asm/io.h>            // for ioremap()
 +#include <linux/delay.h>       // for udelay()

 #define VENDOR_ID      0x8086  // Intel Corporation
 -#define DEVICE_ID      0x109A  // 82573L nic device
 +#define DEVICE_ID      0x100F  // 82545EM-A nic device
 +//#define DEVICE_ID    0x109A  // 82573L nic device
 //#define DEVICE_ID    0x10B9  // 82572EI nic device
 //#define DEVICE_ID    0x107C  // 82541PI nic device
 #define KMEM_SIZE       (4<<12)        // kernel memory allocation
 @@ -46,7 +48,7 @@

 char modname[] = "recv1000";
 char devname[] = "nic";
 -int my_major = 97;
 +int my_major = 0;
 struct pci_dev         *devp;
 unsigned char  mac[6];
 unsigned int   irq;
 @@ -229,7 +231,6 @@

       // issue confirmation-message to the log-file
       printk( "<1>\nInstalling \'%s\' module ", modname );
 -       printk( "(major=%d) \n", my_major );

       // detect the ethernet controller
       devp = pci_get_device( VENDOR_ID, DEVICE_ID, NULL );
 @@ -340,7 +341,17 @@

       // create pseudo-file and register this device-driver
       create_proc_info_entry( modname, 0, NULL, my_get_info );
 -       return  register_chrdev( my_major, devname, &my_fops );
 +       my_major=register_chrdev( my_major, devname, &my_fops );
 +       if(my_major > 0)
 +       {
 +               printk( "register_chrdev(major=%d) \n", my_major );
 +               return 0;
 +       }
 +       else
 +       {
 +               printk("register_chrdev error.\n");
 +               return -1;
 +       }
 }

 module_init( my_init );


-- 
Best Regards :-)
-------------------------------------------
Wang Yao(王耀),[EMAIL PROTECTED] [EMAIL PROTECTED] wangyao01@baidu.com
[EMAIL PROTECTED]
HomePage: http://cudev.cublog.cn
IBM Club Harbin Institute Of Technology
Address:NO.92 West Da-Zhi Street,NanGang District,Harbin,Heilongjiang
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel

Reply via email to