117639f67SWeiXiong Liao /* SPDX-License-Identifier: GPL-2.0 */ 217639f67SWeiXiong Liao 317639f67SWeiXiong Liao #ifndef __PSTORE_BLK_H_ 417639f67SWeiXiong Liao #define __PSTORE_BLK_H_ 517639f67SWeiXiong Liao 617639f67SWeiXiong Liao #include <linux/types.h> 717639f67SWeiXiong Liao #include <linux/pstore.h> 817639f67SWeiXiong Liao #include <linux/pstore_zone.h> 917639f67SWeiXiong Liao 1017639f67SWeiXiong Liao /** 117dcb7848SWeiXiong Liao * struct pstore_device_info - back-end pstore/blk driver structure. 127dcb7848SWeiXiong Liao * 137dcb7848SWeiXiong Liao * @flags: Refer to macro starting with PSTORE_FLAGS defined in 147dcb7848SWeiXiong Liao * linux/pstore.h. It means what front-ends this device support. 157dcb7848SWeiXiong Liao * Zero means all backends for compatible. 16*1d1f6cc5SKees Cook * @zone: The struct pstore_zone_info details. 17*1d1f6cc5SKees Cook * 187dcb7848SWeiXiong Liao */ 197dcb7848SWeiXiong Liao struct pstore_device_info { 207dcb7848SWeiXiong Liao unsigned int flags; 21*1d1f6cc5SKees Cook struct pstore_zone_info zone; 227dcb7848SWeiXiong Liao }; 237dcb7848SWeiXiong Liao 247dcb7848SWeiXiong Liao int register_pstore_device(struct pstore_device_info *dev); 257dcb7848SWeiXiong Liao void unregister_pstore_device(struct pstore_device_info *dev); 267dcb7848SWeiXiong Liao 277dcb7848SWeiXiong Liao /** 281525fb3bSWeiXiong Liao * struct pstore_blk_config - the pstore_blk backend configuration 291525fb3bSWeiXiong Liao * 301525fb3bSWeiXiong Liao * @device: Name of the desired block device 311525fb3bSWeiXiong Liao * @max_reason: Maximum kmsg dump reason to store to block device 321525fb3bSWeiXiong Liao * @kmsg_size: Total size of for kmsg dumps 331525fb3bSWeiXiong Liao * @pmsg_size: Total size of the pmsg storage area 341525fb3bSWeiXiong Liao * @console_size: Total size of the console storage area 351525fb3bSWeiXiong Liao * @ftrace_size: Total size for ftrace logging data (for all CPUs) 361525fb3bSWeiXiong Liao */ 371525fb3bSWeiXiong Liao struct pstore_blk_config { 381525fb3bSWeiXiong Liao char device[80]; 391525fb3bSWeiXiong Liao enum kmsg_dump_reason max_reason; 401525fb3bSWeiXiong Liao unsigned long kmsg_size; 411525fb3bSWeiXiong Liao unsigned long pmsg_size; 421525fb3bSWeiXiong Liao unsigned long console_size; 431525fb3bSWeiXiong Liao unsigned long ftrace_size; 441525fb3bSWeiXiong Liao }; 451525fb3bSWeiXiong Liao 461525fb3bSWeiXiong Liao /** 471525fb3bSWeiXiong Liao * pstore_blk_get_config - get a copy of the pstore_blk backend configuration 481525fb3bSWeiXiong Liao * 491525fb3bSWeiXiong Liao * @info: The sturct pstore_blk_config to be filled in 501525fb3bSWeiXiong Liao * 511525fb3bSWeiXiong Liao * Failure returns negative error code, and success returns 0. 521525fb3bSWeiXiong Liao */ 531525fb3bSWeiXiong Liao int pstore_blk_get_config(struct pstore_blk_config *info); 541525fb3bSWeiXiong Liao 5517639f67SWeiXiong Liao #endif 56