26 #include <linux/kernel.h>
28 #include <linux/device.h>
30 #include <linux/slab.h>
31 #include <linux/module.h>
33 #define DCA_VERSION "1.12.1"
45 static int dca_providers_blocked;
72 static void dca_free_domain(
struct dca_domain *domain)
78 static int dca_provider_ioat_ver_3_0(
struct device *dev)
93 static void unregister_dca_providers(
void)
103 INIT_LIST_HEAD(&unregistered_providers);
107 if (list_empty(&dca_domains)) {
116 list_move(&dca->
node, &unregistered_providers);
118 dca_free_domain(domain);
144 rc = dca_pci_rc_from_dev(dev);
145 domain = dca_find_domain(rc);
148 if (dca_provider_ioat_ver_3_0(dev) && !list_empty(&dca_domains))
149 dca_providers_blocked = 1;
162 rc = dca_pci_rc_from_dev(dev);
163 domain = dca_find_domain(rc);
167 if (!list_empty(&dca_domains))
176 if ((!dev) || (dca->ops->dev_managed(dca, dev)))
200 dca = dca_find_provider_by_dev(dev);
206 pci_rc = dca_pci_rc_from_dev(dev);
207 domain = dca_find_domain(pci_rc);
214 slot = dca->
ops->add_requester(dca, dev);
227 if (dca == dca_find_provider_by_dev(dev))
228 dca->
ops->remove_requester(dca, dev);
251 dca = dca_find_provider_by_dev(dev);
256 slot = dca->
ops->remove_requester(dca, dev);
281 dca = dca_find_provider_by_dev(dev);
286 tag = dca->
ops->get_tag(dca, dev, cpu);
329 alloc_size = (
sizeof(*dca) + priv_size);
362 if (dca_providers_blocked) {
373 domain = dca_get_domain(dev);
377 if (dca_providers_blocked) {
380 unregister_dca_providers();
385 rc = dca_pci_rc_from_dev(dev);
386 newdomain = dca_allocate_domain(rc);
391 domain = dca_get_domain(dev);
395 list_add(&domain->
node, &dca_domains);
425 pci_rc = dca_pci_rc_from_dev(dev);
426 domain = dca_find_domain(pci_rc);
428 dca_free_domain(domain);
454 static int __init dca_init(
void)
460 static void __exit dca_exit(
void)