Lines Matching refs:rpc
116 * @rpc: pointer to a Root Port data structure
120 static void aer_enable_rootport(struct aer_rpc *rpc)
122 struct pci_dev *pdev = rpc->rpd->port;
160 * @rpc: pointer to a Root Port data structure
164 static void aer_disable_rootport(struct aer_rpc *rpc)
166 struct pci_dev *pdev = rpc->rpd->port;
198 struct aer_rpc *rpc = get_service_data(pdev);
208 spin_lock_irqsave(&rpc->e_lock, flags);
213 spin_unlock_irqrestore(&rpc->e_lock, flags);
222 next_prod_idx = rpc->prod_idx + 1;
225 if (next_prod_idx == rpc->cons_idx) {
230 spin_unlock_irqrestore(&rpc->e_lock, flags);
233 rpc->e_sources[rpc->prod_idx].status = status;
234 rpc->e_sources[rpc->prod_idx].id = id;
235 rpc->prod_idx = next_prod_idx;
236 spin_unlock_irqrestore(&rpc->e_lock, flags);
239 schedule_work(&rpc->dpc_handler);
253 struct aer_rpc *rpc;
255 rpc = kzalloc(sizeof(struct aer_rpc), GFP_KERNEL);
256 if (!rpc)
260 spin_lock_init(&rpc->e_lock);
262 rpc->rpd = dev;
263 INIT_WORK(&rpc->dpc_handler, aer_isr);
264 mutex_init(&rpc->rpc_mutex);
265 init_waitqueue_head(&rpc->wait_release);
267 /* Use PCIe bus function to store rpc into PCIe device */
268 set_service_data(dev, rpc);
270 return rpc;
281 struct aer_rpc *rpc = get_service_data(dev);
283 if (rpc) {
285 if (rpc->isr)
288 wait_event(rpc->wait_release, rpc->prod_idx == rpc->cons_idx);
290 aer_disable_rootport(rpc);
291 kfree(rpc);
306 struct aer_rpc *rpc;
314 /* Alloc rpc data structure */
315 rpc = aer_alloc_rpc(dev);
316 if (!rpc) {
317 dev_printk(KERN_DEBUG, device, "alloc rpc failed\n");
330 rpc->isr = 1;
332 aer_enable_rootport(rpc);