<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi All,<br><br>&nbsp;I have a pci driver like:<br><br>define VENDOR_ID 0x1415<br>#define DEVICE_ID1 0xc140<br><br>#include&lt;linux/module.h&gt;<br>#include&lt;linux/version.h&gt;<br>#include&lt;linux/kernel.h&gt;<br>#include&lt;linux/pci.h&gt;<br>#include&lt;linux/ioport.h&gt;<br>#include&lt;asm/unistd.h&gt;<br>#include&lt;linux/slab.h&gt;<br>#include&lt;linux/fs.h&gt;<br>#include&lt;asm/uaccess.h&gt;<br>#include&lt;asm/io.h&gt;<br>#include&lt;linux/kdev_t.h&gt;<br>#include&lt;asm/fcntl.h&gt;<br>#include&lt;linux/sched.h&gt;<br>#include&lt;linux/wait.h&gt;<br>#include&lt;linux/errno.h&gt;<br>#include&lt;asm/irq.h&gt;<br>#include&lt;asm/ioctl.h&gt;<br>#include&lt;linux/string.h&gt;<br>#include&lt;linux/interrupt.h&gt;<br><br>init_module (void)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; short int
 curr_device;<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dev = pci_find_device (VENDOR_ID, DEVICE_ID1, NULL);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; j = pci_enable_device (dev);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; curr_device = 0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printk("Init : Reading and writing Config space.........\n");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pci_read_config_word (dev, 0x02, (u16 *)&amp;curr_device);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printk("Init : Current Device id = %x\n", (curr_device &amp; 0x00FFFF));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; curr_device = 0xc145;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pci_write_config_word (dev, 0x02, curr_device);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pci_read_config_word (dev, 0x02, (u16 *)&amp;curr_device);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printk("Init : After writing to Config space, Current Device id
 = %x\n", (curr_device &amp; 0x00FFFF));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<br>}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void<br>cleanup_module (void)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; curr_device = 0xc145;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pci_write_config_word (dev, 0x02, curr_device);<br><br>Thanks &amp; Regards,<br>D.Giriprasad<br><br><br></td></tr></table>