Lines Matching refs:dev
62 struct mthca_dev *dev, *tmpdev;
72 list_for_each_entry_safe(dev, tmpdev, &tlist, catas_err.list) {
73 struct pci_dev *pdev = dev->pdev;
74 ret = __mthca_restart_one(dev->pdev);
75 /* 'dev' now is not valid */
88 static void handle_catas(struct mthca_dev *dev)
95 event.device = &dev->ib_dev;
98 dev->active = 0;
102 switch (swab32(readl(dev->catas_err.map)) >> 24) {
120 mthca_err(dev, "Catastrophic error detected: %s\n", type);
121 for (i = 0; i < dev->catas_err.size; ++i)
122 mthca_err(dev, " buf[%02x]: %08x\n",
123 i, swab32(readl(dev->catas_err.map + i)));
129 list_add(&dev->catas_err.list, &catas_list);
136 struct mthca_dev *dev = (struct mthca_dev *) dev_ptr;
139 for (i = 0; i < dev->catas_err.size; ++i)
140 if (readl(dev->catas_err.map + i)) {
141 handle_catas(dev);
145 mod_timer(&dev->catas_err.timer,
149 void mthca_start_catas_poll(struct mthca_dev *dev)
153 init_timer(&dev->catas_err.timer);
154 dev->catas_err.map = NULL;
156 addr = pci_resource_start(dev->pdev, 0) +
157 ((pci_resource_len(dev->pdev, 0) - 1) &
158 dev->catas_err.addr);
160 dev->catas_err.map = ioremap(addr, dev->catas_err.size * 4);
161 if (!dev->catas_err.map) {
162 mthca_warn(dev, "couldn't map catastrophic error region "
163 "at 0x%lx/0x%x\n", addr, dev->catas_err.size * 4);
167 dev->catas_err.timer.data = (unsigned long) dev;
168 dev->catas_err.timer.function = poll_catas;
169 dev->catas_err.timer.expires = jiffies + MTHCA_CATAS_POLL_INTERVAL;
170 INIT_LIST_HEAD(&dev->catas_err.list);
171 add_timer(&dev->catas_err.timer);
174 void mthca_stop_catas_poll(struct mthca_dev *dev)
176 del_timer_sync(&dev->catas_err.timer);
178 if (dev->catas_err.map)
179 iounmap(dev->catas_err.map);
182 list_del(&dev->catas_err.list);