Lines Matching refs:bnad

43 	struct bnad *bnad = inode->i_private;  in bnad_debugfs_open_fwtrc()  local
61 spin_lock_irqsave(&bnad->bna_lock, flags); in bnad_debugfs_open_fwtrc()
62 rc = bfa_nw_ioc_debug_fwtrc(&bnad->bna.ioceth.ioc, in bnad_debugfs_open_fwtrc()
65 spin_unlock_irqrestore(&bnad->bna_lock, flags); in bnad_debugfs_open_fwtrc()
71 netdev_warn(bnad->netdev, "failed to collect fwtrc\n"); in bnad_debugfs_open_fwtrc()
83 struct bnad *bnad = inode->i_private; in bnad_debugfs_open_fwsave() local
101 spin_lock_irqsave(&bnad->bna_lock, flags); in bnad_debugfs_open_fwsave()
102 rc = bfa_nw_ioc_debug_fwsave(&bnad->bna.ioceth.ioc, in bnad_debugfs_open_fwsave()
105 spin_unlock_irqrestore(&bnad->bna_lock, flags); in bnad_debugfs_open_fwsave()
111 netdev_warn(bnad->netdev, "failed to collect fwsave\n"); in bnad_debugfs_open_fwsave()
137 bnad_get_debug_drvinfo(struct bnad *bnad, void *buffer, u32 len) in bnad_get_debug_drvinfo() argument
145 spin_lock_irqsave(&bnad->bna_lock, flags); in bnad_get_debug_drvinfo()
146 bfa_nw_ioc_get_attr(&bnad->bna.ioceth.ioc, &drvinfo->ioc_attr); in bnad_get_debug_drvinfo()
147 spin_unlock_irqrestore(&bnad->bna_lock, flags); in bnad_get_debug_drvinfo()
150 fcomp.bnad = bnad; in bnad_get_debug_drvinfo()
153 spin_lock_irqsave(&bnad->bna_lock, flags); in bnad_get_debug_drvinfo()
154 ret = bfa_nw_cee_get_attr(&bnad->bna.cee, &drvinfo->cee_attr, in bnad_get_debug_drvinfo()
157 spin_unlock_irqrestore(&bnad->bna_lock, flags); in bnad_get_debug_drvinfo()
160 spin_unlock_irqrestore(&bnad->bna_lock, flags); in bnad_get_debug_drvinfo()
167 spin_lock_irqsave(&bnad->bna_lock, flags); in bnad_get_debug_drvinfo()
168 ret = bfa_nw_flash_get_attr(&bnad->bna.flash, &drvinfo->flash_attr, in bnad_get_debug_drvinfo()
171 spin_unlock_irqrestore(&bnad->bna_lock, flags); in bnad_get_debug_drvinfo()
174 spin_unlock_irqrestore(&bnad->bna_lock, flags); in bnad_get_debug_drvinfo()
184 struct bnad *bnad = inode->i_private; in bnad_debugfs_open_drvinfo() local
201 mutex_lock(&bnad->conf_mutex); in bnad_debugfs_open_drvinfo()
202 rc = bnad_get_debug_drvinfo(bnad, drv_info->debug_buffer, in bnad_debugfs_open_drvinfo()
204 mutex_unlock(&bnad->conf_mutex); in bnad_debugfs_open_drvinfo()
210 netdev_warn(bnad->netdev, "failed to collect drvinfo\n"); in bnad_debugfs_open_drvinfo()
282 struct bnad *bnad = (struct bnad *)regrd_debug->i_private; in bnad_debugfs_read_regrd() local
285 if (!bnad->regdata) in bnad_debugfs_read_regrd()
289 bnad->regdata, bnad->reglen); in bnad_debugfs_read_regrd()
291 if ((*pos + nbytes) >= bnad->reglen) { in bnad_debugfs_read_regrd()
292 kfree(bnad->regdata); in bnad_debugfs_read_regrd()
293 bnad->regdata = NULL; in bnad_debugfs_read_regrd()
294 bnad->reglen = 0; in bnad_debugfs_read_regrd()
305 struct bnad *bnad = (struct bnad *)regrd_debug->i_private; in bnad_debugfs_write_regrd() local
306 struct bfa_ioc *ioc = &bnad->bna.ioceth.ioc; in bnad_debugfs_write_regrd()
321 netdev_warn(bnad->netdev, "failed to read user buffer\n"); in bnad_debugfs_write_regrd()
327 kfree(bnad->regdata); in bnad_debugfs_write_regrd()
328 bnad->reglen = 0; in bnad_debugfs_write_regrd()
330 bnad->regdata = kzalloc(len << 2, GFP_KERNEL); in bnad_debugfs_write_regrd()
331 if (!bnad->regdata) in bnad_debugfs_write_regrd()
334 bnad->reglen = len << 2; in bnad_debugfs_write_regrd()
341 netdev_warn(bnad->netdev, "failed reg offset check\n"); in bnad_debugfs_write_regrd()
342 kfree(bnad->regdata); in bnad_debugfs_write_regrd()
343 bnad->regdata = NULL; in bnad_debugfs_write_regrd()
344 bnad->reglen = 0; in bnad_debugfs_write_regrd()
349 regbuf = (u32 *)bnad->regdata; in bnad_debugfs_write_regrd()
350 spin_lock_irqsave(&bnad->bna_lock, flags); in bnad_debugfs_write_regrd()
356 spin_unlock_irqrestore(&bnad->bna_lock, flags); in bnad_debugfs_write_regrd()
366 struct bnad *bnad = (struct bnad *)debug->i_private; in bnad_debugfs_write_regwr() local
367 struct bfa_ioc *ioc = &bnad->bna.ioceth.ioc; in bnad_debugfs_write_regwr()
381 netdev_warn(bnad->netdev, "failed to read user buffer\n"); in bnad_debugfs_write_regwr()
392 netdev_warn(bnad->netdev, "failed reg offset check\n"); in bnad_debugfs_write_regwr()
397 spin_lock_irqsave(&bnad->bna_lock, flags); in bnad_debugfs_write_regwr()
399 spin_unlock_irqrestore(&bnad->bna_lock, flags); in bnad_debugfs_write_regwr()
493 bnad_debugfs_init(struct bnad *bnad) in bnad_debugfs_init() argument
504 netdev_warn(bnad->netdev, in bnad_debugfs_init()
511 snprintf(name, sizeof(name), "pci_dev:%s", pci_name(bnad->pcidev)); in bnad_debugfs_init()
512 if (!bnad->port_debugfs_root) { in bnad_debugfs_init()
513 bnad->port_debugfs_root = in bnad_debugfs_init()
520 bnad->bnad_dentry_files[i] = in bnad_debugfs_init()
523 bnad->port_debugfs_root, in bnad_debugfs_init()
524 bnad, in bnad_debugfs_init()
526 if (!bnad->bnad_dentry_files[i]) { in bnad_debugfs_init()
527 netdev_warn(bnad->netdev, in bnad_debugfs_init()
538 bnad_debugfs_uninit(struct bnad *bnad) in bnad_debugfs_uninit() argument
543 if (bnad->bnad_dentry_files[i]) { in bnad_debugfs_uninit()
544 debugfs_remove(bnad->bnad_dentry_files[i]); in bnad_debugfs_uninit()
545 bnad->bnad_dentry_files[i] = NULL; in bnad_debugfs_uninit()
550 if (bnad->port_debugfs_root) { in bnad_debugfs_uninit()
551 debugfs_remove(bnad->port_debugfs_root); in bnad_debugfs_uninit()
552 bnad->port_debugfs_root = NULL; in bnad_debugfs_uninit()