-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ionic: Add hardware init and device commands
The ionic device has a small set of PCI registers, including a device control and data space, and a large set of message commands. Also adds new DEVLINK_INFO_VERSION_GENERIC tags for ASIC_ID, ASIC_REV, and FW. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Shannon Nelson
authored and
David S. Miller
committed
Sep 5, 2019
1 parent
df69ba4
commit fbfb803
Showing
13 changed files
with
3,481 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/* Copyright(c) 2017 - 2019 Pensando Systems, Inc */ | ||
|
||
#include <linux/netdevice.h> | ||
|
||
#include "ionic.h" | ||
#include "ionic_bus.h" | ||
#include "ionic_debugfs.h" | ||
|
||
#ifdef CONFIG_DEBUG_FS | ||
|
||
static struct dentry *ionic_dir; | ||
|
||
void ionic_debugfs_create(void) | ||
{ | ||
ionic_dir = debugfs_create_dir(IONIC_DRV_NAME, NULL); | ||
} | ||
|
||
void ionic_debugfs_destroy(void) | ||
{ | ||
debugfs_remove_recursive(ionic_dir); | ||
} | ||
|
||
void ionic_debugfs_add_dev(struct ionic *ionic) | ||
{ | ||
ionic->dentry = debugfs_create_dir(ionic_bus_info(ionic), ionic_dir); | ||
} | ||
|
||
void ionic_debugfs_del_dev(struct ionic *ionic) | ||
{ | ||
debugfs_remove_recursive(ionic->dentry); | ||
ionic->dentry = NULL; | ||
} | ||
|
||
static int identity_show(struct seq_file *seq, void *v) | ||
{ | ||
struct ionic *ionic = seq->private; | ||
struct ionic_identity *ident; | ||
|
||
ident = &ionic->ident; | ||
|
||
seq_printf(seq, "nlifs: %d\n", ident->dev.nlifs); | ||
seq_printf(seq, "nintrs: %d\n", ident->dev.nintrs); | ||
seq_printf(seq, "ndbpgs_per_lif: %d\n", ident->dev.ndbpgs_per_lif); | ||
seq_printf(seq, "intr_coal_mult: %d\n", ident->dev.intr_coal_mult); | ||
seq_printf(seq, "intr_coal_div: %d\n", ident->dev.intr_coal_div); | ||
|
||
seq_printf(seq, "max_ucast_filters: %d\n", ident->lif.eth.max_ucast_filters); | ||
seq_printf(seq, "max_mcast_filters: %d\n", ident->lif.eth.max_mcast_filters); | ||
|
||
return 0; | ||
} | ||
DEFINE_SHOW_ATTRIBUTE(identity); | ||
|
||
void ionic_debugfs_add_ident(struct ionic *ionic) | ||
{ | ||
debugfs_create_file("identity", 0400, ionic->dentry, | ||
ionic, &identity_fops) ? 0 : -EOPNOTSUPP; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
/* Copyright(c) 2017 - 2019 Pensando Systems, Inc */ | ||
|
||
#ifndef _IONIC_DEBUGFS_H_ | ||
#define _IONIC_DEBUGFS_H_ | ||
|
||
#include <linux/debugfs.h> | ||
|
||
#ifdef CONFIG_DEBUG_FS | ||
|
||
void ionic_debugfs_create(void); | ||
void ionic_debugfs_destroy(void); | ||
void ionic_debugfs_add_dev(struct ionic *ionic); | ||
void ionic_debugfs_del_dev(struct ionic *ionic); | ||
void ionic_debugfs_add_ident(struct ionic *ionic); | ||
#else | ||
static inline void ionic_debugfs_create(void) { } | ||
static inline void ionic_debugfs_destroy(void) { } | ||
static inline void ionic_debugfs_add_dev(struct ionic *ionic) { } | ||
static inline void ionic_debugfs_del_dev(struct ionic *ionic) { } | ||
static inline void ionic_debugfs_add_ident(struct ionic *ionic) { } | ||
#endif | ||
|
||
#endif /* _IONIC_DEBUGFS_H_ */ |
Oops, something went wrong.