• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/drivers/pci/

Lines Matching refs:iov

2  * drivers/pci/iov.c
81 struct pci_sriov *iov = dev->sriov;
87 mutex_lock(&iov->dev->sriov->lock);
91 mutex_unlock(&iov->dev->sriov->lock);
96 pci_read_config_word(dev, iov->pos + PCI_SRIOV_VF_DID, &virtfn->device);
107 do_div(size, iov->total);
118 mutex_unlock(&iov->dev->sriov->lock);
142 mutex_lock(&iov->dev->sriov->lock);
145 mutex_unlock(&iov->dev->sriov->lock);
155 struct pci_sriov *iov = dev->sriov;
176 mutex_lock(&iov->dev->sriov->lock);
179 mutex_unlock(&iov->dev->sriov->lock);
187 struct pci_sriov *iov = dev->sriov;
189 if (!iov->nr_virtfn)
192 if (!(iov->cap & PCI_SRIOV_CAP_VFM))
195 pci_read_config_word(dev, iov->pos + PCI_SRIOV_STATUS, &status);
199 schedule_work(&iov->mtask);
209 struct pci_sriov *iov = container_of(work, struct pci_sriov, mtask);
211 for (i = iov->initial; i < iov->nr_virtfn; i++) {
212 state = readb(iov->mstate + i);
214 writeb(PCI_SRIOV_VFM_AV, iov->mstate + i);
215 state = readb(iov->mstate + i);
217 virtfn_add(iov->self, i, 1);
219 virtfn_remove(iov->self, i, 1);
220 writeb(PCI_SRIOV_VFM_UA, iov->mstate + i);
221 state = readb(iov->mstate + i);
223 virtfn_add(iov->self, i, 0);
227 pci_read_config_word(iov->self, iov->pos + PCI_SRIOV_STATUS, &status);
229 pci_write_config_word(iov->self, iov->pos + PCI_SRIOV_STATUS, status);
237 struct pci_sriov *iov = dev->sriov;
239 if (nr_virtfn <= iov->initial)
242 pci_read_config_dword(dev, iov->pos + PCI_SRIOV_VFM, &table);
252 iov->mstate = ioremap(pa, nr_virtfn);
253 if (!iov->mstate)
256 INIT_WORK(&iov->mtask, sriov_migration_task);
258 iov->ctrl |= PCI_SRIOV_CTRL_VFM | PCI_SRIOV_CTRL_INTR;
259 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
266 struct pci_sriov *iov = dev->sriov;
268 iov->ctrl &= ~(PCI_SRIOV_CTRL_VFM | PCI_SRIOV_CTRL_INTR);
269 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
271 cancel_work_sync(&iov->mtask);
272 iounmap(iov->mstate);
283 struct pci_sriov *iov = dev->sriov;
288 if (iov->nr_virtfn)
291 pci_read_config_word(dev, iov->pos + PCI_SRIOV_INITIAL_VF, &initial);
292 if (initial > iov->total ||
293 (!(iov->cap & PCI_SRIOV_CAP_VFM) && (initial != iov->total)))
296 if (nr_virtfn < 0 || nr_virtfn > iov->total ||
297 (!(iov->cap & PCI_SRIOV_CAP_VFM) && (nr_virtfn > initial)))
300 pci_write_config_word(dev, iov->pos + PCI_SRIOV_NUM_VF, nr_virtfn);
301 pci_read_config_word(dev, iov->pos + PCI_SRIOV_VF_OFFSET, &offset);
302 pci_read_config_word(dev, iov->pos + PCI_SRIOV_VF_STRIDE, &stride);
312 if (nres != iov->nres) {
317 iov->offset = offset;
318 iov->stride = stride;
325 if (iov->link != dev->devfn) {
326 pdev = pci_get_slot(dev->bus, iov->link);
341 iov->ctrl |= PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE;
343 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
347 iov->initial = initial;
357 if (iov->cap & PCI_SRIOV_CAP_VFM) {
364 iov->nr_virtfn = nr_virtfn;
372 iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE);
374 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
378 if (iov->link != dev->devfn)
387 struct pci_sriov *iov = dev->sriov;
389 if (!iov->nr_virtfn)
392 if (iov->cap & PCI_SRIOV_CAP_VFM)
395 for (i = 0; i < iov->nr_virtfn; i++)
398 iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE);
400 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
404 if (iov->link != dev->devfn)
407 iov->nr_virtfn = 0;
417 struct pci_sriov *iov;
476 iov = kzalloc(sizeof(*iov), GFP_KERNEL);
477 if (!iov) {
482 iov->pos = pos;
483 iov->nres = nres;
484 iov->ctrl = ctrl;
485 iov->total = total;
486 iov->offset = offset;
487 iov->stride = stride;
488 iov->pgsz = pgsz;
489 iov->self = dev;
490 pci_read_config_dword(dev, pos + PCI_SRIOV_CAP, &iov->cap);
491 pci_read_config_byte(dev, pos + PCI_SRIOV_FUNC_LINK, &iov->link);
493 iov->link = PCI_DEVFN(PCI_SLOT(dev->devfn), iov->link);
496 iov->dev = pci_dev_get(pdev);
498 iov->dev = dev;
500 mutex_init(&iov->lock);
502 dev->sriov = iov;
533 struct pci_sriov *iov = dev->sriov;
535 pci_read_config_word(dev, iov->pos + PCI_SRIOV_CTRL, &ctrl);
542 pci_write_config_dword(dev, iov->pos + PCI_SRIOV_SYS_PGSIZE, iov->pgsz);
543 pci_write_config_word(dev, iov->pos + PCI_SRIOV_NUM_VF, iov->nr_virtfn);
544 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
545 if (iov->ctrl & PCI_SRIOV_CTRL_VFE)