RE: HI all... reply pls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi ,

>                          thanx for the reply.....I want to use
>ioremap returned pointer as global....in the driver......how can i do it....

 You need to define a pointer for the base address returned by ioremap() in your golbal device structure. You can refer some other PCI device driver in the kernel tree for this.


>>>          I am writing device drivers for PCI card.....I want write
>>>my own Read and Write function calls in Driver module......
>>>I am using "ioremap" function which return a pointer....i want to use
>>>this pointer in my own read and write functionalities....kindly reply
>>>to this as soon as possible.....
>>>
>>>If it's a PCI controler for some board then you need to find the address range of config and IO/Memory space region of the device. From the board data sheat you can easily make out the different address and the length of each regions.
>>> Then you can fing the base address of your device for each region(config, IO/Mem) using  ioremap(). You can use this base address to access the registers in different regions.
>>>
>>> If it's a PCI based card such as serial/eth, then you need to probe for your device based on the devid and venid using
>>>pci_find_device()/ pci_find_slot() based on your requirement. Then find the base address of your device using ioremap()
>>>(the address where your device is mapped can be found fron the data sheet). Now you can access the registers for your device.

Thanks,
Saumendra

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux