Method and apparatus for associating device drivers via a device tree
First Claim
1. A computer-implemented method, comprising:
- maintaining within a kernel of an operating system a device tree having a hierarchical structure executed in a memory by a processor of a computer, the device tree having a plurality of nodes corresponding to a plurality of devices installed in the computer, including a first node associated with a first device and a second node associated with a second device;
encoding within the first node an auxiliary driver identifier for identifying a second device driver associated with the second node and data representing one or more parameters used by a first device driver associated with the first device when invoking the second device driver, wherein the auxiliary driver identifier includes an auxiliary device name associated with the second node of the device tree;
the first device driver retrieving the auxiliary device identifier and the data representing one or more parameters from the device tree and passing the auxiliary device name and the data to the kernel;
receiving, at the kernel, a request from the first device driver for invoking the second device driver, the request including the auxiliary driver identifier;
in response to the request, the kernel identifying a driver handle for the second device driver based on the auxiliary driver identifier, includingperforming a lookup operation in a dictionary, the dictionary having a plurality of entries corresponding to a plurality of devices, wherein each entry includes a first field to store a device name of the device and a second field to store a driver handle of a device driver associated with the identified device,locating an entry associated with the second device driver based on at least one of the auxiliary device name and the data representing one or more parameters,retrieving a driver handle of the second device driver from the located entry of the dictionary; and
returning, by the kernel, the driver handle of the second device driver to the first device driver to enable the first device driver to invoke the second device driver by calling the driver handle of the second device driver, including passing the data representing one or more parameters retrieved from the first node of the device tree, to perform a predetermined operation on the first device, wherein the second device driver, when invoked, does not need to know who invokes the second device driver.
1 Assignment
0 Petitions
Accused Products
Abstract
Techniques for associating device drivers via a device tree are described herein. In one embodiment, a device tree having a hierarchical structure is maintained by a kernel of an operating system. The device tree includes device nodes corresponding to devices installed in a computer, including a first node and a second node. An auxiliary driver identifier is encoded within the first node for identifying a second device driver associated with the second node. The auxiliary driver identifier is used by a first device driver associated with the first node to invoke the second device driver to perform a predetermined operation on a device associated with the first node. Other methods and apparatuses are also described.
-
Citations
20 Claims
-
1. A computer-implemented method, comprising:
-
maintaining within a kernel of an operating system a device tree having a hierarchical structure executed in a memory by a processor of a computer, the device tree having a plurality of nodes corresponding to a plurality of devices installed in the computer, including a first node associated with a first device and a second node associated with a second device; encoding within the first node an auxiliary driver identifier for identifying a second device driver associated with the second node and data representing one or more parameters used by a first device driver associated with the first device when invoking the second device driver, wherein the auxiliary driver identifier includes an auxiliary device name associated with the second node of the device tree; the first device driver retrieving the auxiliary device identifier and the data representing one or more parameters from the device tree and passing the auxiliary device name and the data to the kernel; receiving, at the kernel, a request from the first device driver for invoking the second device driver, the request including the auxiliary driver identifier; in response to the request, the kernel identifying a driver handle for the second device driver based on the auxiliary driver identifier, including performing a lookup operation in a dictionary, the dictionary having a plurality of entries corresponding to a plurality of devices, wherein each entry includes a first field to store a device name of the device and a second field to store a driver handle of a device driver associated with the identified device, locating an entry associated with the second device driver based on at least one of the auxiliary device name and the data representing one or more parameters, retrieving a driver handle of the second device driver from the located entry of the dictionary; and returning, by the kernel, the driver handle of the second device driver to the first device driver to enable the first device driver to invoke the second device driver by calling the driver handle of the second device driver, including passing the data representing one or more parameters retrieved from the first node of the device tree, to perform a predetermined operation on the first device, wherein the second device driver, when invoked, does not need to know who invokes the second device driver. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A non-transitory machine-readable medium having instructions stored therein, which when executed by a machine, cause the machine to perform a method, the method comprising:
-
maintaining within a kernel of an operating system a device tree having a hierarchical structure executed in a memory by a processor of a computer, the device tree having a plurality of nodes corresponding to a plurality of devices installed in the computer, including a first node associated with a first device and a second node associated with a second device; and encoding within the first node an auxiliary driver identifier for identifying a second device driver associated with the second node and data representing one or more parameters used by a first device driver associated with the first device when invoking the second device driver, wherein the auxiliary driver identifier includes an auxiliary device name associated with the second node of the device tree; the first device driver retrieving the auxiliary device identifier and the data representing one or more parameters from the device tree and passing the auxiliary device name and the data to the kernel; receiving, at the kernel, a request from the first device driver for invoking the second device driver, the request including the auxiliary driver identifier; in response to the request, the kernel identifying a driver handle for the second device driver based on the auxiliary driver identifier, including performing a lookup operation in a dictionary, the dictionary having a plurality of entries corresponding to a plurality of devices, wherein each entry includes a first field to store a device name of the device and a second field to store a driver handle of a device driver associated with the identified device, locating an entry associated with the second device driver based on at least one of the auxiliary device name and the data representing one or more parameters, retrieving a driver handle of the second device driver from the located entry of the dictionary; and returning, by the kernel, the driver handle of the second device driver to the first device driver to enable the first device driver to invoke the second device driver by calling the driver handle of the second device driver, including passing the data representing one or more parameters retrieved from the first node of the device tree, to perform a predetermined operation on the first device, wherein the second device driver, when invoked, does not need to know who invokes the second device driver. - View Dependent Claims (7, 8, 9, 10)
-
-
11. An apparatus, comprising:
-
means for maintaining within a kernel of an operating system a device tree having a hierarchical structure executed in a memory by a processor of a computer, the device tree having a plurality of nodes corresponding to a plurality of devices installed in the computer, including a first node associated with a first device and a second node associated with a second device; means for encoding within the first node an auxiliary driver identifier for identifying a second device driver associated with the second node and data representing one or more parameters used by a first device driver associated with the first device when invoking the second device driver, wherein the auxiliary driver identifier includes an auxiliary device name associated with the second node of the device tree; means for the first device driver retrieving the auxiliary device identifier and the data representing one or more parameters from the device tree and passing the auxiliary device name and the data to the kernel; means for receiving, at the kernel, a request from the first device driver for invoking the second device driver, the request including the auxiliary driver identifier; in response to the request, means for the kernel identifying a driver handle for the second device driver based on the auxiliary driver identifier, including means for performing a lookup operation in a dictionary, the dictionary having a plurality of entries corresponding to a plurality of devices, wherein each entry includes a first field to store a device name of the device and a second field to store a driver handle of a device driver associated with the identified device, means for locating an entry associated with the second device driver based on at least one of the auxiliary device name and the data representing one or more parameters, means for retrieving a driver handle of the second device driver from the located entry of the dictionary; and means for returning, by the kernel, the driver handle of the second device driver to the first device driver to enable the first device driver to invoke the second device driver by calling the driver handle of the second device driver, including passing the data representing one or more parameters retrieved from the first node of the device tree, to perform a predetermined operation on the first device, wherein the second device driver, when invoked, does not need to know who invokes the second device driver. - View Dependent Claims (12, 13, 14, 15)
-
-
16. A data processing system, comprising:
-
a processor; and a memory coupled to the processor to store instructions, which when executed from the memory, cause the processor to perform operations, the operations including maintaining within a kernel of an operating system a device tree having a hierarchical structure executed in a memory by a processor of a computer, the device tree having a plurality of nodes corresponding to a plurality of devices installed in the computer, including a first node associated with a first device and a second node associated with a second device, encoding within the first node an auxiliary driver identifier for identifying a second device driver associated with the second node and data representing one or more parameters used by a first device driver associated with the first device when invoking the second device driver, wherein the auxiliary driver identifier includes an auxiliary device name associated with the second node of the device tree, retrieving, by the first device driver, the auxiliary device identifier and the data representing one or more parameters from the device tree and passing the auxiliary device name and the data to the kernel, receiving, at the kernel, a request from the first device driver for invoking the second device driver, the request including the auxiliary driver identifier, in response to the request, the kernel identifying a driver handle for the second device driver based on the auxiliary driver identifier, including performing a lookup operation in a dictionary, the dictionary having a plurality of entries corresponding to a plurality of devices, wherein each entry includes a first field to store a device name of the device and a second field to store a driver handle of a device driver associated with the identified device, locating an entry associated with the second device driver based on at least one of the auxiliary device name and the data representing one or more parameters, retrieving a driver handle of the second device driver from the located entry of the dictionary, and returning, by the kernel, the driver handle of the second device driver to the first device driver to enable the first device driver to invoke the second device driver by calling the driver handle of the second device driver, including passing the data representing one or more parameters retrieved from the first node of the device tree, to perform a predetermined operation on the first device, wherein the second device driver, when invoked, does not need to know who invokes the second device driver. - View Dependent Claims (17, 18, 19, 20)
-
Specification