• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/staging/crystalhd/

Lines Matching refs:adp

30 	struct crystalhd_adp *adp = (struct crystalhd_adp *) arg;
32 if (adp)
33 rc = crystalhd_cmd_interrupt(&adp->cmds);
38 static int chd_dec_enable_int(struct crystalhd_adp *adp)
42 if (!adp || !adp->pdev) {
47 if (adp->pdev->msi_enabled)
48 adp->msi = 1;
50 adp->msi = pci_enable_msi(adp->pdev);
52 rc = request_irq(adp->pdev->irq, chd_dec_isr, IRQF_SHARED,
53 adp->name, (void *)adp);
56 pci_disable_msi(adp->pdev);
62 static int chd_dec_disable_int(struct crystalhd_adp *adp)
64 if (!adp || !adp->pdev) {
69 free_irq(adp->pdev->irq, adp);
71 if (adp->msi)
72 pci_disable_msi(adp->pdev);
77 struct crystalhd_ioctl_data *chd_dec_alloc_iodata(struct crystalhd_adp *adp, bool isr)
82 if (!adp)
85 spin_lock_irqsave(&adp->lock, flags);
87 temp = adp->idata_free_head;
89 adp->idata_free_head = adp->idata_free_head->next;
93 spin_unlock_irqrestore(&adp->lock, flags);
97 void chd_dec_free_iodata(struct crystalhd_adp *adp, struct crystalhd_ioctl_data *iodata,
102 if (!adp || !iodata)
105 spin_lock_irqsave(&adp->lock, flags);
106 iodata->next = adp->idata_free_head;
107 adp->idata_free_head = iodata;
108 spin_unlock_irqrestore(&adp->lock, flags);
133 static int chd_dec_fetch_cdata(struct crystalhd_adp *adp, struct crystalhd_ioctl_data *io,
139 if (!adp || !io || !ua || !m_sz) {
164 static int chd_dec_release_cdata(struct crystalhd_adp *adp,
170 if (!adp || !io || !ua) {
194 static int chd_dec_proc_user_data(struct crystalhd_adp *adp,
201 if (!adp || !io || !ua) {
218 rc = chd_dec_release_cdata(adp, io, ua);
220 rc = chd_dec_fetch_cdata(adp, io, m_sz, ua);
229 static int chd_dec_api_cmd(struct crystalhd_adp *adp, unsigned long ua,
236 temp = chd_dec_alloc_iodata(adp, 0);
245 rc = chd_dec_proc_user_data(adp, temp, ua, 0);
247 sts = func(&adp->cmds, temp);
251 rc = chd_dec_proc_user_data(adp, temp, ua, 1);
255 chd_dec_free_iodata(adp, temp, 0);
265 struct crystalhd_adp *adp = chd_get_adp();
270 if (!adp || !fd) {
271 BCMLOG_ERR("Invalid adp\n");
282 cproc = crystalhd_get_cmd_proc(&adp->cmds, cmd, uc);
289 ret = chd_dec_api_cmd(adp, ua, uc->uid, cmd, cproc);
296 struct crystalhd_adp *adp = chd_get_adp();
302 if (!adp) {
303 BCMLOG_ERR("Invalid adp\n");
307 if (adp->cfg_users >= BC_LINK_MAX_OPENS) {
308 BCMLOG(BCMLOG_INFO, "Already in use.%d\n", adp->cfg_users);
312 sts = crystalhd_user_open(&adp->cmds, &uc);
318 adp->cfg_users++;
327 struct crystalhd_adp *adp = chd_get_adp();
331 if (!adp) {
332 BCMLOG_ERR("Invalid adp\n");
342 crystalhd_user_close(&adp->cmds, uc);
344 adp->cfg_users--;
356 static int __devinit chd_dec_init_chdev(struct crystalhd_adp *adp)
362 if (!adp)
365 adp->chd_dec_major = register_chrdev(0, CRYSTALHD_API_NAME,
367 if (adp->chd_dec_major < 0) {
369 rc = adp->chd_dec_major;
380 dev = device_create(crystalhd_class, NULL, MKDEV(adp->chd_dec_major, 0),
387 rc = crystalhd_create_elem_pool(adp, BC_LINK_ELEM_POOL_SZ);
402 chd_dec_free_iodata(adp, temp, 0);
408 crystalhd_delete_elem_pool(adp);
410 device_destroy(crystalhd_class, MKDEV(adp->chd_dec_major, 0));
417 static void __devexit chd_dec_release_chdev(struct crystalhd_adp *adp)
420 if (!adp)
423 if (adp->chd_dec_major > 0) {
425 device_destroy(crystalhd_class, MKDEV(adp->chd_dec_major, 0));
426 unregister_chrdev(adp->chd_dec_major, CRYSTALHD_API_NAME);
428 adp->chd_dec_major);
431 adp->chd_dec_major = 0;
435 temp = chd_dec_alloc_iodata(adp, 0);
439 crystalhd_delete_elem_pool(adp);
519 BCMLOG_ERR("could not get adp\n");
621 struct crystalhd_adp *adp;
625 adp = (struct crystalhd_adp *)pci_get_drvdata(pdev);
626 if (!adp) {
627 BCMLOG_ERR("could not get adp\n");
631 temp = chd_dec_alloc_iodata(adp, false);
637 sts = crystalhd_suspend(&adp->cmds, temp);
643 chd_dec_free_iodata(adp, temp, false);
644 chd_dec_disable_int(adp);
655 struct crystalhd_adp *adp;
659 adp = (struct crystalhd_adp *)pci_get_drvdata(pdev);
660 if (!adp) {
661 BCMLOG_ERR("could not get adp\n");
676 rc = chd_dec_enable_int(adp);
683 sts = crystalhd_resume(&adp->cmds);
711 void chd_set_log_level(struct crystalhd_adp *adp, char *arg)