Move whole code from ice_fwlog.c/h to libie/fwlog.c/h.
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
select DIMLIB
select LIBIE
select LIBIE_ADMINQ
+ select LIBIE_FWLOG
select NET_DEVLINK
select PACKING
select PLDMFW
ice_ethtool.o \
ice_repr.o \
ice_tc_lib.o \
- ice_fwlog.o \
ice_debugfs.o \
ice_adapter.o
ice-$(CONFIG_PCI_IOV) += \
MODULE_DESCRIPTION(DRV_SUMMARY);
MODULE_IMPORT_NS("LIBIE");
MODULE_IMPORT_NS("LIBIE_ADMINQ");
+MODULE_IMPORT_NS("LIBIE_FWLOG");
MODULE_LICENSE("GPL v2");
MODULE_FIRMWARE(ICE_DDP_PKG_FILE);
#include "ice_protocol_type.h"
#include "ice_sbq_cmd.h"
#include "ice_vlan_mode.h"
-#include "ice_fwlog.h"
+#include <linux/net/intel/libie/fwlog.h>
#include <linux/wait.h>
#include <net/dscp.h>
help
Helper functions used by Intel Ethernet drivers for administration
queue command interface (aka adminq).
+
+config LIBIE_FWLOG
+ tristate
+ select LIBIE_ADMINQ
+ help
+ Library to support firmware logging on device that have support
+ for it. Firmware logging is using admin queue interface to communicate
+ with the device. Debugfs is a user interface used to config logging
+ and dump all collected logs.
obj-$(CONFIG_LIBIE_ADMINQ) += libie_adminq.o
libie_adminq-y := adminq.o
+
+obj-$(CONFIG_LIBIE_FWLOG) += libie_fwlog.o
+
+libie_fwlog-y := fwlog.o
/* Copyright (c) 2022, Intel Corporation. */
#include <linux/debugfs.h>
+#include <linux/export.h>
#include <linux/fs.h>
+#include <linux/net/intel/libie/fwlog.h>
+#include <linux/pci.h>
#include <linux/random.h>
#include <linux/vmalloc.h>
-#include "ice.h"
-#include "ice_common.h"
-#include "ice_fwlog.h"
+
+#define DEFAULT_SYMBOL_NAMESPACE "LIBIE_FWLOG"
/* create a define that has an extra module that doesn't really exist. this
* is so we can add a module 'all' to easily enable/disable all the modules
return 0;
}
+EXPORT_SYMBOL_GPL(libie_fwlog_init);
/**
* libie_fwlog_deinit - unroll FW logging configuration
kfree(fwlog->ring.rings);
}
}
+EXPORT_SYMBOL_GPL(libie_fwlog_deinit);
/**
* libie_get_fwlog_data - copy the FW log data from ARQ event
libie_fwlog_ring_increment(&fwlog->ring.head, fwlog->ring.size);
}
}
+EXPORT_SYMBOL_GPL(libie_get_fwlog_data);
void libie_fwlog_reregister(struct libie_fwlog *fwlog)
{
if (libie_fwlog_register(fwlog))
fwlog->cfg.options &= ~LIBIE_FWLOG_OPTION_IS_REGISTERED;
}
+EXPORT_SYMBOL_GPL(libie_fwlog_reregister);
+
+MODULE_DESCRIPTION("Intel(R) Ethernet common library");
+MODULE_LICENSE("GPL");
LIBIE_AQC_FW_LOG_ID_TSDRV,
LIBIE_AQC_FW_LOG_ID_PFREG,
LIBIE_AQC_FW_LOG_ID_MDLVER,
- LIBIE_AQC_FW_LOG_ID_MAX,
+ LIBIE_AQC_FW_LOG_ID_MAX
};
/* Set FW Logging configuration (indirect 0xFF30)
#define LIBIE_AQC_FW_LOG_AQ_REGISTER BIT(0)
#define LIBIE_AQC_FW_LOG_AQ_QUERY BIT(2)
-#define LIBIE_AQC_FW_LOG_MIN_RESOLUTION (1)
-#define LIBIE_AQC_FW_LOG_MAX_RESOLUTION (128)
+#define LIBIE_AQC_FW_LOG_MIN_RESOLUTION 1
+#define LIBIE_AQC_FW_LOG_MAX_RESOLUTION 128
struct libie_aqc_fw_log {
u8 cmd_flags;
#ifndef _LIBIE_FWLOG_H_
#define _LIBIE_FWLOG_H_
-#include "ice_adminq_cmd.h"
+
+#include <linux/net/intel/libie/adminq.h>
/* Only a single log level should be set and all log levels under the set value
* are enabled, e.g. if log level is set to LIBIE_FW_LOG_LEVEL_VERBOSE, then all