Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ice, libie: move fwlog code to libie

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>

authored by

Michal Swiatkowski and committed by
Tony Nguyen
f3b3fc1f 4b5f288a

+33 -9
+1
drivers/net/ethernet/intel/Kconfig
··· 297 297 select DIMLIB 298 298 select LIBIE 299 299 select LIBIE_ADMINQ 300 + select LIBIE_FWLOG 300 301 select NET_DEVLINK 301 302 select PACKING 302 303 select PLDMFW
-1
drivers/net/ethernet/intel/ice/Makefile
··· 42 42 ice_ethtool.o \ 43 43 ice_repr.o \ 44 44 ice_tc_lib.o \ 45 - ice_fwlog.o \ 46 45 ice_debugfs.o \ 47 46 ice_adapter.o 48 47 ice-$(CONFIG_PCI_IOV) += \
+12 -3
drivers/net/ethernet/intel/ice/ice_fwlog.c drivers/net/ethernet/intel/libie/fwlog.c
··· 2 2 /* Copyright (c) 2022, Intel Corporation. */ 3 3 4 4 #include <linux/debugfs.h> 5 + #include <linux/export.h> 5 6 #include <linux/fs.h> 7 + #include <linux/net/intel/libie/fwlog.h> 8 + #include <linux/pci.h> 6 9 #include <linux/random.h> 7 10 #include <linux/vmalloc.h> 8 - #include "ice.h" 9 - #include "ice_common.h" 10 - #include "ice_fwlog.h" 11 + 12 + #define DEFAULT_SYMBOL_NAMESPACE "LIBIE_FWLOG" 11 13 12 14 /* create a define that has an extra module that doesn't really exist. this 13 15 * is so we can add a module 'all' to easily enable/disable all the modules ··· 1039 1037 1040 1038 return 0; 1041 1039 } 1040 + EXPORT_SYMBOL_GPL(libie_fwlog_init); 1042 1041 1043 1042 /** 1044 1043 * libie_fwlog_deinit - unroll FW logging configuration ··· 1074 1071 kfree(fwlog->ring.rings); 1075 1072 } 1076 1073 } 1074 + EXPORT_SYMBOL_GPL(libie_fwlog_deinit); 1077 1075 1078 1076 /** 1079 1077 * libie_get_fwlog_data - copy the FW log data from ARQ event ··· 1099 1095 libie_fwlog_ring_increment(&fwlog->ring.head, fwlog->ring.size); 1100 1096 } 1101 1097 } 1098 + EXPORT_SYMBOL_GPL(libie_get_fwlog_data); 1102 1099 1103 1100 void libie_fwlog_reregister(struct libie_fwlog *fwlog) 1104 1101 { ··· 1109 1104 if (libie_fwlog_register(fwlog)) 1110 1105 fwlog->cfg.options &= ~LIBIE_FWLOG_OPTION_IS_REGISTERED; 1111 1106 } 1107 + EXPORT_SYMBOL_GPL(libie_fwlog_reregister); 1108 + 1109 + MODULE_DESCRIPTION("Intel(R) Ethernet common library"); 1110 + MODULE_LICENSE("GPL");
+2 -1
drivers/net/ethernet/intel/ice/ice_fwlog.h include/linux/net/intel/libie/fwlog.h
··· 3 3 4 4 #ifndef _LIBIE_FWLOG_H_ 5 5 #define _LIBIE_FWLOG_H_ 6 - #include "ice_adminq_cmd.h" 6 + 7 + #include <linux/net/intel/libie/adminq.h> 7 8 8 9 /* Only a single log level should be set and all log levels under the set value 9 10 * are enabled, e.g. if log level is set to LIBIE_FW_LOG_LEVEL_VERBOSE, then all
+1
drivers/net/ethernet/intel/ice/ice_main.c
··· 39 39 MODULE_DESCRIPTION(DRV_SUMMARY); 40 40 MODULE_IMPORT_NS("LIBIE"); 41 41 MODULE_IMPORT_NS("LIBIE_ADMINQ"); 42 + MODULE_IMPORT_NS("LIBIE_FWLOG"); 42 43 MODULE_LICENSE("GPL v2"); 43 44 MODULE_FIRMWARE(ICE_DDP_PKG_FILE); 44 45
+1 -1
drivers/net/ethernet/intel/ice/ice_type.h
··· 17 17 #include "ice_protocol_type.h" 18 18 #include "ice_sbq_cmd.h" 19 19 #include "ice_vlan_mode.h" 20 - #include "ice_fwlog.h" 20 + #include <linux/net/intel/libie/fwlog.h> 21 21 #include <linux/wait.h> 22 22 #include <net/dscp.h> 23 23
+9
drivers/net/ethernet/intel/libie/Kconfig
··· 14 14 help 15 15 Helper functions used by Intel Ethernet drivers for administration 16 16 queue command interface (aka adminq). 17 + 18 + config LIBIE_FWLOG 19 + tristate 20 + select LIBIE_ADMINQ 21 + help 22 + Library to support firmware logging on device that have support 23 + for it. Firmware logging is using admin queue interface to communicate 24 + with the device. Debugfs is a user interface used to config logging 25 + and dump all collected logs.
+4
drivers/net/ethernet/intel/libie/Makefile
··· 8 8 obj-$(CONFIG_LIBIE_ADMINQ) += libie_adminq.o 9 9 10 10 libie_adminq-y := adminq.o 11 + 12 + obj-$(CONFIG_LIBIE_FWLOG) += libie_fwlog.o 13 + 14 + libie_fwlog-y := fwlog.o
+3 -3
include/linux/net/intel/libie/adminq.h
··· 265 265 LIBIE_AQC_FW_LOG_ID_TSDRV, 266 266 LIBIE_AQC_FW_LOG_ID_PFREG, 267 267 LIBIE_AQC_FW_LOG_ID_MDLVER, 268 - LIBIE_AQC_FW_LOG_ID_MAX, 268 + LIBIE_AQC_FW_LOG_ID_MAX 269 269 }; 270 270 271 271 /* Set FW Logging configuration (indirect 0xFF30) ··· 280 280 #define LIBIE_AQC_FW_LOG_AQ_REGISTER BIT(0) 281 281 #define LIBIE_AQC_FW_LOG_AQ_QUERY BIT(2) 282 282 283 - #define LIBIE_AQC_FW_LOG_MIN_RESOLUTION (1) 284 - #define LIBIE_AQC_FW_LOG_MAX_RESOLUTION (128) 283 + #define LIBIE_AQC_FW_LOG_MIN_RESOLUTION 1 284 + #define LIBIE_AQC_FW_LOG_MAX_RESOLUTION 128 285 285 286 286 struct libie_aqc_fw_log { 287 287 u8 cmd_flags;