Back to home page

OSCL-LXR

 
 

    


0001 /* Broadcom NetXtreme-C/E network driver.
0002  *
0003  * Copyright (c) 2018 Broadcom Inc
0004  *
0005  * This program is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation.
0008  */
0009 
0010 #ifndef BNXT_COREDUMP_H
0011 #define BNXT_COREDUMP_H
0012 
0013 #include <linux/utsname.h>
0014 #include <linux/time.h>
0015 #include <linux/rtc.h>
0016 
0017 struct bnxt_coredump_segment_hdr {
0018     __u8 signature[4];
0019     __le32 component_id;
0020     __le32 segment_id;
0021     __le32 flags;
0022     __u8 low_version;
0023     __u8 high_version;
0024     __le16 function_id;
0025     __le32 offset;
0026     __le32 length;
0027     __le32 status;
0028     __le32 duration;
0029     __le32 data_offset;
0030     __le32 instance;
0031     __le32 rsvd[5];
0032 };
0033 
0034 struct bnxt_coredump_record {
0035     __u8 signature[4];
0036     __le32 flags;
0037     __u8 low_version;
0038     __u8 high_version;
0039     __u8 asic_state;
0040     __u8 rsvd0[5];
0041     char system_name[32];
0042     __le16 year;
0043     __le16 month;
0044     __le16 day;
0045     __le16 hour;
0046     __le16 minute;
0047     __le16 second;
0048     __le16 utc_bias;
0049     __le16 rsvd1;
0050     char commandline[256];
0051     __le32 total_segments;
0052     __le32 os_ver_major;
0053     __le32 os_ver_minor;
0054     __le32 rsvd2;
0055     char os_name[32];
0056     __le16 end_year;
0057     __le16 end_month;
0058     __le16 end_day;
0059     __le16 end_hour;
0060     __le16 end_minute;
0061     __le16 end_second;
0062     __le16 end_utc_bias;
0063     __le32 asic_id1;
0064     __le32 asic_id2;
0065     __le32 coredump_status;
0066     __u8 ioctl_low_version;
0067     __u8 ioctl_high_version;
0068     __le16 rsvd3[313];
0069 };
0070 
0071 #define BNXT_CRASH_DUMP_LEN (8 << 20)
0072 
0073 #define COREDUMP_LIST_BUF_LEN       2048
0074 #define COREDUMP_RETRIEVE_BUF_LEN   4096
0075 
0076 struct bnxt_coredump {
0077     void        *data;
0078     int     data_size;
0079     u16     total_segs;
0080 };
0081 
0082 #define BNXT_COREDUMP_BUF_LEN(len) ((len) - sizeof(struct bnxt_coredump_record))
0083 
0084 struct bnxt_hwrm_dbg_dma_info {
0085     void *dest_buf;
0086     int dest_buf_size;
0087     u16 dma_len;
0088     u16 seq_off;
0089     u16 data_len_off;
0090     u16 segs;
0091     u32 seg_start;
0092     u32 buf_len;
0093 };
0094 
0095 struct hwrm_dbg_cmn_input {
0096     __le16 req_type;
0097     __le16 cmpl_ring;
0098     __le16 seq_id;
0099     __le16 target_id;
0100     __le64 resp_addr;
0101     __le64 host_dest_addr;
0102     __le32 host_buf_len;
0103 };
0104 
0105 struct hwrm_dbg_cmn_output {
0106     __le16 error_code;
0107     __le16 req_type;
0108     __le16 seq_id;
0109     __le16 resp_len;
0110     u8 flags;
0111     #define HWRM_DBG_CMN_FLAGS_MORE 1
0112 };
0113 
0114 int bnxt_get_coredump(struct bnxt *bp, u16 dump_type, void *buf, u32 *dump_len);
0115 u32 bnxt_get_coredump_length(struct bnxt *bp, u16 dump_type);
0116 
0117 #endif