<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi All,<br><br> I have a pci driver like:<br><br>define VENDOR_ID 0x1415<br>#define DEVICE_ID1 0xc140<br><br>#include<linux/module.h><br>#include<linux/version.h><br>#include<linux/kernel.h><br>#include<linux/pci.h><br>#include<linux/ioport.h><br>#include<asm/unistd.h><br>#include<linux/slab.h><br>#include<linux/fs.h><br>#include<asm/uaccess.h><br>#include<asm/io.h><br>#include<linux/kdev_t.h><br>#include<asm/fcntl.h><br>#include<linux/sched.h><br>#include<linux/wait.h><br>#include<linux/errno.h><br>#include<asm/irq.h><br>#include<asm/ioctl.h><br>#include<linux/string.h><br>#include<linux/interrupt.h><br><br>init_module (void)<br>{<br> short int
curr_device;<br><br><br> dev = pci_find_device (VENDOR_ID, DEVICE_ID1, NULL);<br> j = pci_enable_device (dev);<br> curr_device = 0;<br> printk("Init : Reading and writing Config space.........\n");<br> pci_read_config_word (dev, 0x02, (u16 *)&curr_device);<br> printk("Init : Current Device id = %x\n", (curr_device & 0x00FFFF));<br> curr_device = 0xc145;<br> pci_write_config_word (dev, 0x02, curr_device);<br> pci_read_config_word (dev, 0x02, (u16 *)&curr_device);<br> printk("Init : After writing to Config space, Current Device id
= %x\n", (curr_device & 0x00FFFF));<br> return 0;<br>}<br><br> void<br>cleanup_module (void)<br>{<br> printk ("Closing pci \n");<br>}<br><br>When I insmod this driver after build, it shows:<br>Jul 20 15:11:03 localhost kernel: Init : Reading and writing Config space.........<br>Jul 20 15:11:03 localhost kernel: Init : Current Device id = c140<br>Jul 20 15:11:03 localhost kernel: Init : After writing to Config space, Current Device id = c140<br><br>Any clues as to why is not writing 0xc145 to the pci config space?<br> curr_device = 0xc145;<br> pci_write_config_word (dev, 0x02, curr_device);<br><br>Thanks & Regards,<br>D.Giriprasad</td></tr></table>