• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/infiniband/hw/ipath/

Lines Matching defs:dd

84 	struct ipath_devdata *dd = pd->port_dd;
117 ret = dd->ipath_f_get_base_info(pd, kinfo);
121 kinfo->spi_rcvhdr_cnt = dd->ipath_rcvhdrcnt;
122 kinfo->spi_rcvhdrent_size = dd->ipath_rcvhdrentsize;
123 kinfo->spi_tidegrcnt = dd->ipath_rcvegrcnt;
124 kinfo->spi_rcv_egrbufsize = dd->ipath_rcvegrbufsize;
133 kinfo->spi_tidcnt = dd->ipath_rcvtidcnt / subport_cnt;
135 kinfo->spi_tidcnt += dd->ipath_rcvtidcnt % subport_cnt;
140 kinfo->spi_nports = dd->ipath_cfgports;
142 kinfo->spi_unit = dd->ipath_unit;
164 kinfo->spi_pioavailaddr = (u64) dd->ipath_pioavailregs_phys;
166 (void *) dd->ipath_statusp -
167 (void *) dd->ipath_pioavailregs_dma;
169 kinfo->spi_piocnt = dd->ipath_pbufsport;
171 kinfo->__spi_uregbase = (u64) dd->ipath_uregbase +
172 dd->ipath_palign * pd->port_port;
174 kinfo->spi_piocnt = (dd->ipath_pbufsport / subport_cnt) +
175 (dd->ipath_pbufsport % subport_cnt);
178 dd->ipath_palign *
179 (dd->ipath_pbufsport - kinfo->spi_piocnt);
183 kinfo->spi_piocnt = dd->ipath_pbufsport / subport_cnt;
185 dd->ipath_palign * kinfo->spi_piocnt * slave;
188 kinfo->spi_port_uregbase = (u64) dd->ipath_uregbase +
189 dd->ipath_palign * pd->port_port;
217 kinfo->spi_pioindex = (kinfo->spi_piobufbase - dd->ipath_piobufbase) /
218 dd->ipath_palign;
219 kinfo->spi_pioalign = dd->ipath_palign;
222 kinfo->spi_piosize = dd->ipath_ibmaxlen;
223 kinfo->spi_mtu = dd->ipath_ibmaxlen; /* maxlen, not ibmtu */
227 kinfo->spi_hw_version = dd->ipath_revision;
274 struct ipath_devdata *dd = pd->port_dd;
282 if (!dd->ipath_pageshadow) {
297 porttid = pd->port_port * dd->ipath_rcvtidcnt;
299 tidcnt = dd->ipath_rcvtidcnt;
303 tidcnt = (dd->ipath_rcvtidcnt / pd->port_subport_cnt) +
304 (dd->ipath_rcvtidcnt % pd->port_subport_cnt);
305 tidoff = dd->ipath_rcvtidcnt - tidcnt;
309 tidcnt = dd->ipath_rcvtidcnt / pd->port_subport_cnt;
316 dev_info(&dd->pcidev->dev, "Process tried to allocate %u "
321 tidlist = &((u16 *) &pagep[dd->ipath_rcvtidcnt])[tidoff];
326 tidbase = (u64 __iomem *) (((char __iomem *) dd->ipath_kregbase) +
327 dd->ipath_rcvtidbase +
356 dev_info(&dd->pcidev->dev,
366 if (!dd->ipath_pageshadow[porttid + tid])
385 dd->ipath_pageshadow[porttid + tid] = pagep[i];
386 dd->ipath_physshadow[porttid + tid] = ipath_map_page(
387 dd->pcidev, pagep[i], 0, PAGE_SIZE,
393 physaddr = dd->ipath_physshadow[porttid + tid];
399 dd->ipath_f_put_tid(dd, &tidbase[tid], 1, physaddr);
422 if (dd->ipath_pageshadow[porttid + tid]) {
425 dd->ipath_f_put_tid(dd, &tidbase[tid], 1,
426 dd->ipath_tidinvalid);
427 pci_unmap_page(dd->pcidev,
428 dd->ipath_physshadow[porttid + tid],
430 dd->ipath_pageshadow[porttid + tid] = NULL;
489 struct ipath_devdata *dd = pd->port_dd;
493 if (!dd->ipath_pageshadow) {
504 porttid = pd->port_port * dd->ipath_rcvtidcnt;
506 tidcnt = dd->ipath_rcvtidcnt;
508 tidcnt = (dd->ipath_rcvtidcnt / pd->port_subport_cnt) +
509 (dd->ipath_rcvtidcnt % pd->port_subport_cnt);
510 porttid += dd->ipath_rcvtidcnt - tidcnt;
512 tidcnt = dd->ipath_rcvtidcnt / pd->port_subport_cnt;
515 tidbase = (u64 __iomem *) ((char __iomem *)(dd->ipath_kregbase) +
516 dd->ipath_rcvtidbase +
538 if (dd->ipath_pageshadow[porttid + tid]) {
541 dd->ipath_f_put_tid(dd, &tidbase[tid], 1,
542 dd->ipath_tidinvalid);
543 pci_unmap_page(dd->pcidev,
544 dd->ipath_physshadow[porttid + tid],
547 &dd->ipath_pageshadow[porttid + tid], 1);
548 dd->ipath_pageshadow[porttid + tid] = NULL;
581 struct ipath_devdata *dd = pd->port_dd;
594 pd->port_port, key, dd->ipath_pkeys[0],
595 atomic_read(&dd->ipath_pkeyrefs[0]), dd->ipath_pkeys[1],
596 atomic_read(&dd->ipath_pkeyrefs[1]), dd->ipath_pkeys[2],
597 atomic_read(&dd->ipath_pkeyrefs[2]), dd->ipath_pkeys[3],
598 atomic_read(&dd->ipath_pkeyrefs[3]));
632 for (any = i = 0; i < ARRAY_SIZE(dd->ipath_pkeys); i++) {
633 if (!dd->ipath_pkeys[i]) {
637 if (dd->ipath_pkeys[i] == key) {
638 atomic_t *pkrefs = &dd->ipath_pkeyrefs[i];
659 if ((dd->ipath_pkeys[i] & 0x7FFF) == lkey) {
675 for (any = i = 0; i < ARRAY_SIZE(dd->ipath_pkeys); i++) {
676 if (!dd->ipath_pkeys[i] &&
677 atomic_inc_return(&dd->ipath_pkeyrefs[i]) == 1) {
682 pd->port_pkeys[pidx] = dd->ipath_pkeys[i] = key;
684 (u64) dd->ipath_pkeys[0] |
685 ((u64) dd->ipath_pkeys[1] << 16) |
686 ((u64) dd->ipath_pkeys[2] << 32) |
687 ((u64) dd->ipath_pkeys[3] << 48);
693 dd, dd->ipath_kregs->kr_partitionkey, pkey);
720 struct ipath_devdata *dd = pd->port_dd;
723 start_stop ? "en" : "dis", dd->ipath_unit,
743 &dd->ipath_rcvctrl);
746 &dd->ipath_rcvctrl);
747 ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvctrl,
748 dd->ipath_rcvctrl);
750 ipath_read_kreg64(dd, dd->ipath_kregs->kr_scratch);
759 ipath_read_ureg32(dd, ur_rcvhdrtail, pd->port_port);
767 struct ipath_devdata *dd)
773 oldpkey = (u64) dd->ipath_pkeys[0] |
774 ((u64) dd->ipath_pkeys[1] << 16) |
775 ((u64) dd->ipath_pkeys[2] << 32) |
776 ((u64) dd->ipath_pkeys[3] << 48);
783 for (j = 0; j < ARRAY_SIZE(dd->ipath_pkeys); j++) {
785 if ((dd->ipath_pkeys[j] & 0x7fff) !=
788 if (atomic_dec_and_test(&dd->ipath_pkeyrefs[j])) {
794 dd->ipath_pkeys[j] = 0;
801 atomic_read(&dd->ipath_pkeyrefs[j]));
807 u64 pkey = (u64) dd->ipath_pkeys[0] |
808 ((u64) dd->ipath_pkeys[1] << 16) |
809 ((u64) dd->ipath_pkeys[2] << 32) |
810 ((u64) dd->ipath_pkeys[3] << 48);
815 ipath_write_kreg(dd, dd->ipath_kregs->kr_partitionkey,
828 struct ipath_devdata *dd = pd->port_dd;
843 egrperchunk = size / dd->ipath_rcvegrbufsize;
844 egrcnt = dd->ipath_rcvegrcnt;
864 struct ipath_devdata *dd = pd->port_dd;
878 egrcnt = dd->ipath_rcvegrcnt;
881 egrsize = dd->ipath_rcvegrbufsize;
904 &dd->pcidev->dev, size, &pd->port_rcvegrbuf_phys[e],
920 dd->ipath_f_put_tid(dd, e + egroff +
923 dd->ipath_kregbase +
924 dd->ipath_rcvegrbase), 0, pa);
936 dma_free_coherent(&dd->pcidev->dev, size,
956 struct ipath_devdata *dd = pd->port_dd;
961 dev_info(&dd->pcidev->dev,
970 dev_info(&dd->pcidev->dev,
984 dev_info(&dd->pcidev->dev, "%s port%u mmap of %lx, %x "
995 static int mmap_ureg(struct vm_area_struct *vma, struct ipath_devdata *dd,
1007 dev_info(&dd->pcidev->dev, "FAIL mmap userreg: reqlen "
1011 phys = dd->ipath_physaddr + ureg;
1024 struct ipath_devdata *dd,
1037 if ((vma->vm_end - vma->vm_start) > (piocnt * dd->ipath_palign)) {
1038 dev_info(&dd->pcidev->dev, "FAIL mmap piobufs: "
1045 phys = dd->ipath_physaddr + piobufs;
1076 struct ipath_devdata *dd = pd->port_dd;
1085 dev_info(&dd->pcidev->dev, "FAIL on egr bufs: "
1094 dev_info(&dd->pcidev->dev, "Can't map eager buffers as "
1151 struct ipath_devdata *dd;
1160 dd = pd->port_dd;
1191 dev_info(&dd->pcidev->dev,
1234 struct ipath_devdata *dd;
1244 dd = pd->port_dd;
1267 vma->vm_end - vma->vm_start, dd->ipath_unit,
1282 ureg = dd->ipath_uregbase + dd->ipath_palign * pd->port_port;
1285 piocnt = dd->ipath_pbufsport;
1289 piocnt = (dd->ipath_pbufsport / pd->port_subport_cnt) +
1290 (dd->ipath_pbufsport % pd->port_subport_cnt);
1292 dd->ipath_palign * (dd->ipath_pbufsport - piocnt);
1297 piocnt = dd->ipath_pbufsport / pd->port_subport_cnt;
1298 piobufs = pd->port_piobufs + dd->ipath_palign * piocnt * slave;
1302 ret = mmap_ureg(vma, dd, ureg);
1304 ret = mmap_piobufs(vma, dd, pd, piobufs, piocnt);
1305 else if (pgaddr == dd->ipath_pioavailregs_phys)
1308 (void *) dd->ipath_pioavailregs_dma,
1332 dev_info(&dd->pcidev->dev,
1347 struct ipath_devdata *dd;
1352 dd = pd->port_dd;
1355 set_bit(bit, &dd->ipath_rcvctrl);
1366 ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvctrl,
1367 dd->ipath_rcvctrl);
1369 head = ipath_read_ureg32(dd, ur_rcvhdrhead, pd->port_port);
1370 tail = ipath_read_ureg32(dd, ur_rcvhdrtail, pd->port_port);
1374 if (dd->ipath_rhdrhead_intr_off) /* arm rcv interrupt */
1375 (void)ipath_write_ureg(dd, ur_rcvhdrhead,
1376 dd->ipath_rhdrhead_intr_off
1394 clear_bit(bit, &dd->ipath_rcvctrl);
1395 ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvctrl,
1396 dd->ipath_rcvctrl);
1402 static int init_subports(struct ipath_devdata *dd,
1419 dev_info(&dd->pcidev->dev,
1440 size = ALIGN(dd->ipath_rcvhdrcnt * dd->ipath_rcvhdrentsize *
1476 static int try_alloc_port(struct ipath_devdata *dd, int port,
1483 if (!(pd = dd->ipath_pd[port])) {
1493 ptmp = kmalloc(dd->ipath_rcvtidcnt * sizeof(u16) +
1494 dd->ipath_rcvtidcnt * sizeof(struct page **),
1497 ipath_dev_err(dd, "Unable to allocate portdata "
1504 dd->ipath_pd[port] = pd;
1505 dd->ipath_pd[port]->port_port = port;
1506 dd->ipath_pd[port]->port_dd = dd;
1507 dd->ipath_pd[port]->port_tid_pg_list = ptmp;
1508 init_waitqueue_head(&dd->ipath_pd[port]->port_wait);
1513 if ((ret = init_subports(dd, pd, uinfo)) != 0)
1516 current->comm, current->pid, dd->ipath_unit,
1531 static inline int usable(struct ipath_devdata *dd)
1533 return dd &&
1534 (dd->ipath_flags & IPATH_PRESENT) &&
1535 dd->ipath_kregbase &&
1536 dd->ipath_lid &&
1537 !(dd->ipath_flags & (IPATH_LINKDOWN | IPATH_DISABLED
1544 struct ipath_devdata *dd = ipath_lookup(unit);
1547 if (!dd) {
1552 if (!usable(dd)) {
1557 for (i = 1; i < dd->ipath_cfgports; i++) {
1558 ret = try_alloc_port(dd, i, fp, uinfo);
1627 struct ipath_devdata *dd = ipath_lookup(ndev);
1629 if (!usable(dd))
1631 if (i >= dd->ipath_cfgports)
1637 ret = try_alloc_port(dd, i, fp, uinfo);
1682 struct ipath_devdata *dd = ipath_lookup(ndev);
1684 if (!dd)
1686 for (i = 1; i < dd->ipath_cfgports; i++) {
1687 struct ipath_portdata *pd = dd->ipath_pd[i];
1711 dd->ipath_unit, pd->port_port);
1788 struct ipath_devdata *dd;
1798 dd = pd->port_dd;
1801 ret = ipath_setrcvhdrsize(dd, uinfo->spu_rcvhdrsize);
1809 pd->port_piobufs = dd->ipath_piobufbase +
1810 dd->ipath_pbufsport * (pd->port_port - 1) * dd->ipath_palign;
1820 ret = ipath_create_rcvhdrq(dd, pd);
1831 head32 = ipath_read_ureg32(dd, ur_rcvegrindextail, pd->port_port);
1832 ipath_write_ureg(dd, ur_rcvegrindexhead, head32, pd->port_port);
1833 dd->ipath_lastegrheads[pd->port_port] = -1;
1834 dd->ipath_lastrcvhdrqtails[pd->port_port] = -1;
1841 * dd->ipath_kregs->kr_rcvctrl. The update only happens on
1850 &dd->ipath_rcvctrl);
1851 ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvctrl,
1852 dd->ipath_rcvctrl & ~INFINIPATH_R_TAILUPD);
1853 ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvctrl,
1854 dd->ipath_rcvctrl);
1873 struct ipath_devdata *dd = pd->port_dd;
1874 int port_tidbase = pd->port_port * dd->ipath_rcvtidcnt;
1875 int i, cnt = 0, maxtid = port_tidbase + dd->ipath_rcvtidcnt;
1880 if (!dd->ipath_pageshadow[i])
1883 pci_unmap_page(dd->pcidev, dd->ipath_physshadow[i],
1885 ipath_release_user_pages_on_close(&dd->ipath_pageshadow[i],
1887 dd->ipath_pageshadow[i] = NULL;
1907 struct ipath_devdata *dd;
1928 dd = pd->port_dd;
1953 if (dd->ipath_kregbase) {
1957 &dd->ipath_rcvctrl);
1958 ipath_write_kreg( dd, dd->ipath_kregs->kr_rcvctrl,
1959 dd->ipath_rcvctrl);
1962 (void)ipath_read_kreg64(dd, dd->ipath_kregs->kr_scratch);
1965 ipath_clean_part_key(pd, dd);
1975 ipath_write_kreg_port(dd,
1976 dd->ipath_kregs->kr_rcvhdrtailaddr, port,
1977 dd->ipath_dummy_hdrq_phys);
1978 ipath_write_kreg_port(dd, dd->ipath_kregs->kr_rcvhdraddr,
1979 pd->port_port, dd->ipath_dummy_hdrq_phys);
1981 i = dd->ipath_pbufsport * (port - 1);
1982 ipath_disarm_piobufs(dd, i, dd->ipath_pbufsport);
1984 dd->ipath_f_clear_tids(dd, pd->port_port);
1986 if (dd->ipath_pageshadow)
1991 dd->ipath_unit, port);
1995 dd->ipath_pd[pd->port_port] = NULL; /* before releasing mutex */
1997 ipath_free_pddata(dd, pd); /* after releasing the mutex */
2046 static int ipath_force_pio_avail_update(struct ipath_devdata *dd)
2048 u64 reg = dd->ipath_sendctrl;
2051 ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl, reg);
2052 ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl, dd->ipath_sendctrl);
2334 int ipath_user_add(struct ipath_devdata *dd)
2342 ipath_dev_err(dd, "Unable to set up user support: "
2349 ipath_dev_err(dd, "Could not create wildcard "
2357 snprintf(name, sizeof(name), "ipath%d", dd->ipath_unit);
2359 ret = init_cdev(dd->ipath_unit + 1, name, &ipath_file_ops,
2360 &dd->user_cdev, &dd->user_class_dev);
2362 ipath_dev_err(dd, "Could not create user minor %d, %s\n",
2363 dd->ipath_unit + 1, name);
2373 void ipath_user_remove(struct ipath_devdata *dd)
2375 cleanup_cdev(&dd->user_cdev, &dd->user_class_dev);