__request_resource implemenation doubt

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

 



hi all,

i was going through the implementation of "pci_request_regions"
(which i came across reading 8139too.c). As far as i can figure out
this fxn bascially associates a name with the physical address
requested by the PCI device (using pdev's start and length members).
......right??? Why is this association required? one use i figured
was in displaying what region a particular device has when we do
"cat /proc/iomem", anything else??

Comig to the main question -

"pci_request_regions" calls "__request_resource" via the following
sequence::

pci_request_regions > pci_request_region > request_mem_region (a
macro which expands to __request_region)
__request_region > __request_resource

Now __request_region passes the &iomem_resource to __request_resource
iomem_resource is initalized to
{ "PCI mem", 0x00000000, 0xffffffff, IORESOURCE_MEM } in resource.c

Now in __request_resource the "root" var. (which is a pointer to
the iomem_resource struct we passed in __request_region) is used
like this

struct resource *tmp, **p;
...
p = &root->child;

child member of root is NULL right??? cos it was'nt initialized
to any specfic val (so it wud have the default val. of NULL).

But i'm sure i'm missing something as all this is perfectly
working code! any helps appreciated.

-mandeep

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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