Copy the code and: - change ICE_AQC to LIBIE_AQC - change ice_aqc to libie_aqc - move definitions outside the structures
Unified · Split
| @@ -2399,42 +2399,6 @@ struct ice_aqc_event_lan_overflow { · 2398 unmodified lines | |||
| 2399 | u8 reserved[8]; | 2399 | u8 reserved[8]; |
| 2400 | }; | 2400 | }; |
| 2401 | 2401 | ||
| 2402 | enum ice_aqc_fw_logging_mod { | ||
| 2403 | ICE_AQC_FW_LOG_ID_GENERAL = 0, | ||
| 2404 | ICE_AQC_FW_LOG_ID_CTRL, | ||
| 2405 | ICE_AQC_FW_LOG_ID_LINK, | ||
| 2406 | ICE_AQC_FW_LOG_ID_LINK_TOPO, | ||
| 2407 | ICE_AQC_FW_LOG_ID_DNL, | ||
| 2408 | ICE_AQC_FW_LOG_ID_I2C, | ||
| 2409 | ICE_AQC_FW_LOG_ID_SDP, | ||
| 2410 | ICE_AQC_FW_LOG_ID_MDIO, | ||
| 2411 | ICE_AQC_FW_LOG_ID_ADMINQ, | ||
| 2412 | ICE_AQC_FW_LOG_ID_HDMA, | ||
| 2413 | ICE_AQC_FW_LOG_ID_LLDP, | ||
| 2414 | ICE_AQC_FW_LOG_ID_DCBX, | ||
| 2415 | ICE_AQC_FW_LOG_ID_DCB, | ||
| 2416 | ICE_AQC_FW_LOG_ID_XLR, | ||
| 2417 | ICE_AQC_FW_LOG_ID_NVM, | ||
| 2418 | ICE_AQC_FW_LOG_ID_AUTH, | ||
| 2419 | ICE_AQC_FW_LOG_ID_VPD, | ||
| 2420 | ICE_AQC_FW_LOG_ID_IOSF, | ||
| 2421 | ICE_AQC_FW_LOG_ID_PARSER, | ||
| 2422 | ICE_AQC_FW_LOG_ID_SW, | ||
| 2423 | ICE_AQC_FW_LOG_ID_SCHEDULER, | ||
| 2424 | ICE_AQC_FW_LOG_ID_TXQ, | ||
| 2425 | ICE_AQC_FW_LOG_ID_RSVD, | ||
| 2426 | ICE_AQC_FW_LOG_ID_POST, | ||
| 2427 | ICE_AQC_FW_LOG_ID_WATCHDOG, | ||
| 2428 | ICE_AQC_FW_LOG_ID_TASK_DISPATCH, | ||
| 2429 | ICE_AQC_FW_LOG_ID_MNG, | ||
| 2430 | ICE_AQC_FW_LOG_ID_SYNCE, | ||
| 2431 | ICE_AQC_FW_LOG_ID_HEALTH, | ||
| 2432 | ICE_AQC_FW_LOG_ID_TSDRV, | ||
| 2433 | ICE_AQC_FW_LOG_ID_PFREG, | ||
| 2434 | ICE_AQC_FW_LOG_ID_MDLVER, | ||
| 2435 | ICE_AQC_FW_LOG_ID_MAX, | ||
| 2436 | }; | ||
| 2437 | |||
| 2438 | enum ice_aqc_health_status_mask { | 2402 | enum ice_aqc_health_status_mask { |
| 2439 | ICE_AQC_HEALTH_STATUS_SET_PF_SPECIFIC_MASK = BIT(0), | 2403 | ICE_AQC_HEALTH_STATUS_SET_PF_SPECIFIC_MASK = BIT(0), |
| 2440 | ICE_AQC_HEALTH_STATUS_SET_ALL_PF_MASK = BIT(1), | 2404 | ICE_AQC_HEALTH_STATUS_SET_ALL_PF_MASK = BIT(1), |
| @@ -2516,48 +2480,6 @@ struct ice_aqc_health_status_elem { · 75 unmodified lines | |||
| 2516 | __le32 internal_data2; | 2480 | __le32 internal_data2; |
| 2517 | }; | 2481 | }; |
| 2518 | 2482 | ||
| 2519 | /* Set FW Logging configuration (indirect 0xFF30) | ||
| 2520 | * Register for FW Logging (indirect 0xFF31) | ||
| 2521 | * Query FW Logging (indirect 0xFF32) | ||
| 2522 | * FW Log Event (indirect 0xFF33) | ||
| 2523 | */ | ||
| 2524 | struct ice_aqc_fw_log { | ||
| 2525 | u8 cmd_flags; | ||
| 2526 | #define ICE_AQC_FW_LOG_CONF_UART_EN BIT(0) | ||
| 2527 | #define ICE_AQC_FW_LOG_CONF_AQ_EN BIT(1) | ||
| 2528 | #define ICE_AQC_FW_LOG_QUERY_REGISTERED BIT(2) | ||
| 2529 | #define ICE_AQC_FW_LOG_CONF_SET_VALID BIT(3) | ||
| 2530 | #define ICE_AQC_FW_LOG_AQ_REGISTER BIT(0) | ||
| 2531 | #define ICE_AQC_FW_LOG_AQ_QUERY BIT(2) | ||
| 2532 | |||
| 2533 | u8 rsp_flag; | ||
| 2534 | __le16 fw_rt_msb; | ||
| 2535 | union { | ||
| 2536 | struct { | ||
| 2537 | __le32 fw_rt_lsb; | ||
| 2538 | } sync; | ||
| 2539 | struct { | ||
| 2540 | __le16 log_resolution; | ||
| 2541 | #define ICE_AQC_FW_LOG_MIN_RESOLUTION (1) | ||
| 2542 | #define ICE_AQC_FW_LOG_MAX_RESOLUTION (128) | ||
| 2543 | |||
| 2544 | __le16 mdl_cnt; | ||
| 2545 | } cfg; | ||
| 2546 | } ops; | ||
| 2547 | __le32 addr_high; | ||
| 2548 | __le32 addr_low; | ||
| 2549 | }; | ||
| 2550 | |||
| 2551 | /* Response Buffer for: | ||
| 2552 | * Set Firmware Logging Configuration (0xFF30) | ||
| 2553 | * Query FW Logging (0xFF32) | ||
| 2554 | */ | ||
| 2555 | struct ice_aqc_fw_log_cfg_resp { | ||
| 2556 | __le16 module_identifier; | ||
| 2557 | u8 log_level; | ||
| 2558 | u8 rsvd0; | ||
| 2559 | }; | ||
| 2560 | |||
| 2561 | /* Admin Queue command opcodes */ | 2483 | /* Admin Queue command opcodes */ |
| 2562 | enum ice_adminq_opc { | 2484 | enum ice_adminq_opc { |
| 2563 | /* AQ commands */ | 2485 | /* AQ commands */ |
| @@ -12,10 +12,11 @@ static struct dentry *ice_debugfs_root; · 11 unmodified lines | |||
| 12 | /* create a define that has an extra module that doesn't really exist. this | 12 | /* create a define that has an extra module that doesn't really exist. this |
| 13 | * is so we can add a module 'all' to easily enable/disable all the modules | 13 | * is so we can add a module 'all' to easily enable/disable all the modules |
| 14 | */ | 14 | */ |
| 15 | #define ICE_NR_FW_LOG_MODULES (ICE_AQC_FW_LOG_ID_MAX + 1) | 15 | #define ICE_NR_FW_LOG_MODULES (LIBIE_AQC_FW_LOG_ID_MAX + 1) |
| 16 | 16 | ||
| 17 | /* the ordering in this array is important. it matches the ordering of the | 17 | /* the ordering in this array is important. it matches the ordering of the |
| 18 | * values in the FW so the index is the same value as in ice_aqc_fw_logging_mod | 18 | * values in the FW so the index is the same value as in |
| 19 | * libie_aqc_fw_logging_mod | ||
| 19 | */ | 20 | */ |
| 20 | static const char * const ice_fwlog_module_string[] = { | 21 | static const char * const ice_fwlog_module_string[] = { |
| 21 | "general", | 22 | "general", |
| @@ -84,7 +85,7 @@ ice_fwlog_print_module_cfg(struct ice_fwlog_cfg *cfg, int module, · 62 unmodified lines | |||
| 84 | { | 85 | { |
| 85 | struct ice_fwlog_module_entry *entry; | 86 | struct ice_fwlog_module_entry *entry; |
| 86 | 87 | ||
| 87 | if (module != ICE_AQC_FW_LOG_ID_MAX) { | 88 | if (module != LIBIE_AQC_FW_LOG_ID_MAX) { |
| 88 | entry = &cfg->module_entries[module]; | 89 | entry = &cfg->module_entries[module]; |
| 89 | 90 | ||
| 90 | seq_printf(s, "\tModule: %s, Log Level: %s\n", | 91 | seq_printf(s, "\tModule: %s, Log Level: %s\n", |
| @@ -93,7 +94,7 @@ ice_fwlog_print_module_cfg(struct ice_fwlog_cfg *cfg, int module, · 2 unmodified lines | |||
| 93 | } else { | 94 | } else { |
| 94 | int i; | 95 | int i; |
| 95 | 96 | ||
| 96 | for (i = 0; i < ICE_AQC_FW_LOG_ID_MAX; i++) { | 97 | for (i = 0; i < LIBIE_AQC_FW_LOG_ID_MAX; i++) { |
| 97 | entry = &cfg->module_entries[i]; | 98 | entry = &cfg->module_entries[i]; |
| 98 | 99 | ||
| 99 | seq_printf(s, "\tModule: %s, Log Level: %s\n", | 100 | seq_printf(s, "\tModule: %s, Log Level: %s\n", |
| @@ -190,7 +191,7 @@ ice_debugfs_module_write(struct file *filp, const char __user *buf, · 90 unmodified lines | |||
| 190 | return -EINVAL; | 191 | return -EINVAL; |
| 191 | } | 192 | } |
| 192 | 193 | ||
| 193 | if (module != ICE_AQC_FW_LOG_ID_MAX) { | 194 | if (module != LIBIE_AQC_FW_LOG_ID_MAX) { |
| 194 | fwlog->cfg.module_entries[module].log_level = log_level; | 195 | fwlog->cfg.module_entries[module].log_level = log_level; |
| 195 | } else { | 196 | } else { |
| 196 | /* the module 'all' is a shortcut so that we can set | 197 | /* the module 'all' is a shortcut so that we can set |
| @@ -198,7 +199,7 @@ ice_debugfs_module_write(struct file *filp, const char __user *buf, · 1 unmodified line | |||
| 198 | */ | 199 | */ |
| 199 | int i; | 200 | int i; |
| 200 | 201 | ||
| 201 | for (i = 0; i < ICE_AQC_FW_LOG_ID_MAX; i++) | 202 | for (i = 0; i < LIBIE_AQC_FW_LOG_ID_MAX; i++) |
| 202 | fwlog->cfg.module_entries[i].log_level = log_level; | 203 | fwlog->cfg.module_entries[i].log_level = log_level; |
| 203 | } | 204 | } |
| 204 | 205 | ||
| @@ -266,11 +267,11 @@ ice_debugfs_nr_messages_write(struct file *filp, const char __user *buf, · 61 unmodified lines | |||
| 266 | if (ret) | 267 | if (ret) |
| 267 | return ret; | 268 | return ret; |
| 268 | 269 | ||
| 269 | if (nr_messages < ICE_AQC_FW_LOG_MIN_RESOLUTION || | 270 | if (nr_messages < LIBIE_AQC_FW_LOG_MIN_RESOLUTION || |
| 270 | nr_messages > ICE_AQC_FW_LOG_MAX_RESOLUTION) { | 271 | nr_messages > LIBIE_AQC_FW_LOG_MAX_RESOLUTION) { |
| 271 | dev_err(dev, "Invalid FW log number of messages %d, value must be between %d - %d\n", | 272 | dev_err(dev, "Invalid FW log number of messages %d, value must be between %d - %d\n", |
| 272 | nr_messages, ICE_AQC_FW_LOG_MIN_RESOLUTION, | 273 | nr_messages, LIBIE_AQC_FW_LOG_MIN_RESOLUTION, |
| 273 | ICE_AQC_FW_LOG_MAX_RESOLUTION); | 274 | LIBIE_AQC_FW_LOG_MAX_RESOLUTION); |
| 274 | return -EINVAL; | 275 | return -EINVAL; |
| 275 | } | 276 | } |
| 276 | 277 | ||
| @@ -142,8 +142,8 @@ static bool ice_fwlog_supported(struct ice_fwlog *fwlog) · 141 unmodified lines | |||
| 142 | */ | 142 | */ |
| 143 | static int ice_aq_fwlog_get(struct ice_fwlog *fwlog, struct ice_fwlog_cfg *cfg) | 143 | static int ice_aq_fwlog_get(struct ice_fwlog *fwlog, struct ice_fwlog_cfg *cfg) |
| 144 | { | 144 | { |
| 145 | struct ice_aqc_fw_log_cfg_resp *fw_modules; | 145 | struct libie_aqc_fw_log_cfg_resp *fw_modules; |
| 146 | struct ice_aqc_fw_log *cmd; | 146 | struct libie_aqc_fw_log *cmd; |
| 147 | struct libie_aq_desc desc; | 147 | struct libie_aq_desc desc; |
| 148 | u16 module_id_cnt; | 148 | u16 module_id_cnt; |
| 149 | int status; | 149 | int status; |
| @@ -156,10 +156,10 @@ static int ice_aq_fwlog_get(struct ice_fwlog *fwlog, struct ice_fwlog_cfg *cfg) · 6 unmodified lines | |||
| 156 | if (!buf) | 156 | if (!buf) |
| 157 | return -ENOMEM; | 157 | return -ENOMEM; |
| 158 | 158 | ||
| 159 | ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_fw_logs_query); | 159 | ice_fill_dflt_direct_cmd_desc(&desc, libie_aqc_opc_fw_logs_query); |
| 160 | cmd = libie_aq_raw(&desc); | 160 | cmd = libie_aq_raw(&desc); |
| 161 | 161 | ||
| 162 | cmd->cmd_flags = ICE_AQC_FW_LOG_AQ_QUERY; | 162 | cmd->cmd_flags = LIBIE_AQC_FW_LOG_AQ_QUERY; |
| 163 | 163 | ||
| 164 | status = fwlog->send_cmd(fwlog->priv, &desc, buf, ICE_AQ_MAX_BUF_LEN); | 164 | status = fwlog->send_cmd(fwlog->priv, &desc, buf, ICE_AQ_MAX_BUF_LEN); |
| 165 | if (status) { | 165 | if (status) { |
| @@ -168,26 +168,26 @@ static int ice_aq_fwlog_get(struct ice_fwlog *fwlog, struct ice_fwlog_cfg *cfg) · 2 unmodified lines | |||
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | module_id_cnt = le16_to_cpu(cmd->ops.cfg.mdl_cnt); | 170 | module_id_cnt = le16_to_cpu(cmd->ops.cfg.mdl_cnt); |
| 171 | if (module_id_cnt < ICE_AQC_FW_LOG_ID_MAX) { | 171 | if (module_id_cnt < LIBIE_AQC_FW_LOG_ID_MAX) { |
| 172 | dev_dbg(&fwlog->pdev->dev, "FW returned less than the expected number of FW log module IDs\n"); | 172 | dev_dbg(&fwlog->pdev->dev, "FW returned less than the expected number of FW log module IDs\n"); |
| 173 | } else if (module_id_cnt > ICE_AQC_FW_LOG_ID_MAX) { | 173 | } else if (module_id_cnt > LIBIE_AQC_FW_LOG_ID_MAX) { |
| 174 | dev_dbg(&fwlog->pdev->dev, "FW returned more than expected number of FW log module IDs, setting module_id_cnt to software expected max %u\n", | 174 | dev_dbg(&fwlog->pdev->dev, "FW returned more than expected number of FW log module IDs, setting module_id_cnt to software expected max %u\n", |
| 175 | ICE_AQC_FW_LOG_ID_MAX); | 175 | LIBIE_AQC_FW_LOG_ID_MAX); |
| 176 | module_id_cnt = ICE_AQC_FW_LOG_ID_MAX; | 176 | module_id_cnt = LIBIE_AQC_FW_LOG_ID_MAX; |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | cfg->log_resolution = le16_to_cpu(cmd->ops.cfg.log_resolution); | 179 | cfg->log_resolution = le16_to_cpu(cmd->ops.cfg.log_resolution); |
| 180 | if (cmd->cmd_flags & ICE_AQC_FW_LOG_CONF_AQ_EN) | 180 | if (cmd->cmd_flags & LIBIE_AQC_FW_LOG_CONF_AQ_EN) |
| 181 | cfg->options |= ICE_FWLOG_OPTION_ARQ_ENA; | 181 | cfg->options |= ICE_FWLOG_OPTION_ARQ_ENA; |
| 182 | if (cmd->cmd_flags & ICE_AQC_FW_LOG_CONF_UART_EN) | 182 | if (cmd->cmd_flags & LIBIE_AQC_FW_LOG_CONF_UART_EN) |
| 183 | cfg->options |= ICE_FWLOG_OPTION_UART_ENA; | 183 | cfg->options |= ICE_FWLOG_OPTION_UART_ENA; |
| 184 | if (cmd->cmd_flags & ICE_AQC_FW_LOG_QUERY_REGISTERED) | 184 | if (cmd->cmd_flags & LIBIE_AQC_FW_LOG_QUERY_REGISTERED) |
| 185 | cfg->options |= ICE_FWLOG_OPTION_IS_REGISTERED; | 185 | cfg->options |= ICE_FWLOG_OPTION_IS_REGISTERED; |
| 186 | 186 | ||
| 187 | fw_modules = (struct ice_aqc_fw_log_cfg_resp *)buf; | 187 | fw_modules = (struct libie_aqc_fw_log_cfg_resp *)buf; |
| 188 | 188 | ||
| 189 | for (i = 0; i < module_id_cnt; i++) { | 189 | for (i = 0; i < module_id_cnt; i++) { |
| 190 | struct ice_aqc_fw_log_cfg_resp *fw_module = &fw_modules[i]; | 190 | struct libie_aqc_fw_log_cfg_resp *fw_module = &fw_modules[i]; |
| 191 | 191 | ||
| 192 | cfg->module_entries[i].module_id = | 192 | cfg->module_entries[i].module_id = |
| 193 | le16_to_cpu(fw_module->module_identifier); | 193 | le16_to_cpu(fw_module->module_identifier); |
| @@ -325,8 +325,8 @@ ice_aq_fwlog_set(struct ice_fwlog *fwlog, · 131 unmodified lines | |||
| 325 | struct ice_fwlog_module_entry *entries, u16 num_entries, | 325 | struct ice_fwlog_module_entry *entries, u16 num_entries, |
| 326 | u16 options, u16 log_resolution) | 326 | u16 options, u16 log_resolution) |
| 327 | { | 327 | { |
| 328 | struct ice_aqc_fw_log_cfg_resp *fw_modules; | 328 | struct libie_aqc_fw_log_cfg_resp *fw_modules; |
| 329 | struct ice_aqc_fw_log *cmd; | 329 | struct libie_aqc_fw_log *cmd; |
| 330 | struct libie_aq_desc desc; | 330 | struct libie_aq_desc desc; |
| 331 | int status; | 331 | int status; |
| 332 | int i; | 332 | int i; |
| @@ -341,19 +341,19 @@ ice_aq_fwlog_set(struct ice_fwlog *fwlog, · 8 unmodified lines | |||
| 341 | fw_modules[i].log_level = entries[i].log_level; | 341 | fw_modules[i].log_level = entries[i].log_level; |
| 342 | } | 342 | } |
| 343 | 343 | ||
| 344 | ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_fw_logs_config); | 344 | ice_fill_dflt_direct_cmd_desc(&desc, libie_aqc_opc_fw_logs_config); |
| 345 | desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); | 345 | desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); |
| 346 | 346 | ||
| 347 | cmd = libie_aq_raw(&desc); | 347 | cmd = libie_aq_raw(&desc); |
| 348 | 348 | ||
| 349 | cmd->cmd_flags = ICE_AQC_FW_LOG_CONF_SET_VALID; | 349 | cmd->cmd_flags = LIBIE_AQC_FW_LOG_CONF_SET_VALID; |
| 350 | cmd->ops.cfg.log_resolution = cpu_to_le16(log_resolution); | 350 | cmd->ops.cfg.log_resolution = cpu_to_le16(log_resolution); |
| 351 | cmd->ops.cfg.mdl_cnt = cpu_to_le16(num_entries); | 351 | cmd->ops.cfg.mdl_cnt = cpu_to_le16(num_entries); |
| 352 | 352 | ||
| 353 | if (options & ICE_FWLOG_OPTION_ARQ_ENA) | 353 | if (options & ICE_FWLOG_OPTION_ARQ_ENA) |
| 354 | cmd->cmd_flags |= ICE_AQC_FW_LOG_CONF_AQ_EN; | 354 | cmd->cmd_flags |= LIBIE_AQC_FW_LOG_CONF_AQ_EN; |
| 355 | if (options & ICE_FWLOG_OPTION_UART_ENA) | 355 | if (options & ICE_FWLOG_OPTION_UART_ENA) |
| 356 | cmd->cmd_flags |= ICE_AQC_FW_LOG_CONF_UART_EN; | 356 | cmd->cmd_flags |= LIBIE_AQC_FW_LOG_CONF_UART_EN; |
| 357 | 357 | ||
| 358 | status = fwlog->send_cmd(fwlog->priv, &desc, fw_modules, | 358 | status = fwlog->send_cmd(fwlog->priv, &desc, fw_modules, |
| 359 | sizeof(*fw_modules) * num_entries); | 359 | sizeof(*fw_modules) * num_entries); |
| @@ -382,7 +382,7 @@ int ice_fwlog_set(struct ice_fwlog *fwlog, struct ice_fwlog_cfg *cfg) · 22 unmodified lines | |||
| 382 | return -EOPNOTSUPP; | 382 | return -EOPNOTSUPP; |
| 383 | 383 | ||
| 384 | return ice_aq_fwlog_set(fwlog, cfg->module_entries, | 384 | return ice_aq_fwlog_set(fwlog, cfg->module_entries, |
| 385 | ICE_AQC_FW_LOG_ID_MAX, cfg->options, | 385 | LIBIE_AQC_FW_LOG_ID_MAX, cfg->options, |
| 386 | cfg->log_resolution); | 386 | cfg->log_resolution); |
| 387 | } | 387 | } |
| 388 | 388 | ||
| @@ -393,14 +393,14 @@ int ice_fwlog_set(struct ice_fwlog *fwlog, struct ice_fwlog_cfg *cfg) · 4 unmodified lines | |||
| 393 | */ | 393 | */ |
| 394 | static int ice_aq_fwlog_register(struct ice_fwlog *fwlog, bool reg) | 394 | static int ice_aq_fwlog_register(struct ice_fwlog *fwlog, bool reg) |
| 395 | { | 395 | { |
| 396 | struct ice_aqc_fw_log *cmd; | 396 | struct libie_aqc_fw_log *cmd; |
| 397 | struct libie_aq_desc desc; | 397 | struct libie_aq_desc desc; |
| 398 | 398 | ||
| 399 | ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_fw_logs_register); | 399 | ice_fill_dflt_direct_cmd_desc(&desc, libie_aqc_opc_fw_logs_register); |
| 400 | cmd = libie_aq_raw(&desc); | 400 | cmd = libie_aq_raw(&desc); |
| 401 | 401 | ||
| 402 | if (reg) | 402 | if (reg) |
| 403 | cmd->cmd_flags = ICE_AQC_FW_LOG_AQ_REGISTER; | 403 | cmd->cmd_flags = LIBIE_AQC_FW_LOG_AQ_REGISTER; |
| 404 | 404 | ||
| 405 | return fwlog->send_cmd(fwlog->priv, &desc, NULL, 0); | 405 | return fwlog->send_cmd(fwlog->priv, &desc, NULL, 0); |
| 406 | } | 406 | } |
| @@ -29,7 +29,7 @@ struct ice_fwlog_module_entry { · 28 unmodified lines | |||
| 29 | 29 | ||
| 30 | struct ice_fwlog_cfg { | 30 | struct ice_fwlog_cfg { |
| 31 | /* list of modules for configuring log level */ | 31 | /* list of modules for configuring log level */ |
| 32 | struct ice_fwlog_module_entry module_entries[ICE_AQC_FW_LOG_ID_MAX]; | 32 | struct ice_fwlog_module_entry module_entries[LIBIE_AQC_FW_LOG_ID_MAX]; |
| 33 | /* options used to configure firmware logging */ | 33 | /* options used to configure firmware logging */ |
| 34 | u16 options; | 34 | u16 options; |
| 35 | #define ICE_FWLOG_OPTION_ARQ_ENA BIT(0) | 35 | #define ICE_FWLOG_OPTION_ARQ_ENA BIT(0) |
| @@ -222,6 +222,94 @@ struct libie_aqc_list_caps_elem { · 221 unmodified lines | |||
| 222 | }; | 222 | }; |
| 223 | LIBIE_CHECK_STRUCT_LEN(32, libie_aqc_list_caps_elem); | 223 | LIBIE_CHECK_STRUCT_LEN(32, libie_aqc_list_caps_elem); |
| 224 | 224 | ||
| 225 | /* Admin Queue command opcodes */ | ||
| 226 | enum libie_adminq_opc { | ||
| 227 | /* FW Logging Commands */ | ||
| 228 | libie_aqc_opc_fw_logs_config = 0xFF30, | ||
| 229 | libie_aqc_opc_fw_logs_register = 0xFF31, | ||
| 230 | libie_aqc_opc_fw_logs_query = 0xFF32, | ||
| 231 | libie_aqc_opc_fw_logs_event = 0xFF33, | ||
| 232 | }; | ||
| 233 | |||
| 234 | enum libie_aqc_fw_logging_mod { | ||
| 235 | LIBIE_AQC_FW_LOG_ID_GENERAL = 0, | ||
| 236 | LIBIE_AQC_FW_LOG_ID_CTRL, | ||
| 237 | LIBIE_AQC_FW_LOG_ID_LINK, | ||
| 238 | LIBIE_AQC_FW_LOG_ID_LINK_TOPO, | ||
| 239 | LIBIE_AQC_FW_LOG_ID_DNL, | ||
| 240 | LIBIE_AQC_FW_LOG_ID_I2C, | ||
| 241 | LIBIE_AQC_FW_LOG_ID_SDP, | ||
| 242 | LIBIE_AQC_FW_LOG_ID_MDIO, | ||
| 243 | LIBIE_AQC_FW_LOG_ID_ADMINQ, | ||
| 244 | LIBIE_AQC_FW_LOG_ID_HDMA, | ||
| 245 | LIBIE_AQC_FW_LOG_ID_LLDP, | ||
| 246 | LIBIE_AQC_FW_LOG_ID_DCBX, | ||
| 247 | LIBIE_AQC_FW_LOG_ID_DCB, | ||
| 248 | LIBIE_AQC_FW_LOG_ID_XLR, | ||
| 249 | LIBIE_AQC_FW_LOG_ID_NVM, | ||
| 250 | LIBIE_AQC_FW_LOG_ID_AUTH, | ||
| 251 | LIBIE_AQC_FW_LOG_ID_VPD, | ||
| 252 | LIBIE_AQC_FW_LOG_ID_IOSF, | ||
| 253 | LIBIE_AQC_FW_LOG_ID_PARSER, | ||
| 254 | LIBIE_AQC_FW_LOG_ID_SW, | ||
| 255 | LIBIE_AQC_FW_LOG_ID_SCHEDULER, | ||
| 256 | LIBIE_AQC_FW_LOG_ID_TXQ, | ||
| 257 | LIBIE_AQC_FW_LOG_ID_RSVD, | ||
| 258 | LIBIE_AQC_FW_LOG_ID_POST, | ||
| 259 | LIBIE_AQC_FW_LOG_ID_WATCHDOG, | ||
| 260 | LIBIE_AQC_FW_LOG_ID_TASK_DISPATCH, | ||
| 261 | LIBIE_AQC_FW_LOG_ID_MNG, | ||
| 262 | LIBIE_AQC_FW_LOG_ID_SYNCE, | ||
| 263 | LIBIE_AQC_FW_LOG_ID_HEALTH, | ||
| 264 | LIBIE_AQC_FW_LOG_ID_TSDRV, | ||
| 265 | LIBIE_AQC_FW_LOG_ID_PFREG, | ||
| 266 | LIBIE_AQC_FW_LOG_ID_MDLVER, | ||
| 267 | LIBIE_AQC_FW_LOG_ID_MAX, | ||
| 268 | }; | ||
| 269 | |||
| 270 | /* Set FW Logging configuration (indirect 0xFF30) | ||
| 271 | * Register for FW Logging (indirect 0xFF31) | ||
| 272 | * Query FW Logging (indirect 0xFF32) | ||
| 273 | * FW Log Event (indirect 0xFF33) | ||
| 274 | */ | ||
| 275 | #define LIBIE_AQC_FW_LOG_CONF_UART_EN BIT(0) | ||
| 276 | #define LIBIE_AQC_FW_LOG_CONF_AQ_EN BIT(1) | ||
| 277 | #define LIBIE_AQC_FW_LOG_QUERY_REGISTERED BIT(2) | ||
| 278 | #define LIBIE_AQC_FW_LOG_CONF_SET_VALID BIT(3) | ||
| 279 | #define LIBIE_AQC_FW_LOG_AQ_REGISTER BIT(0) | ||
| 280 | #define LIBIE_AQC_FW_LOG_AQ_QUERY BIT(2) | ||
| 281 | |||
| 282 | #define LIBIE_AQC_FW_LOG_MIN_RESOLUTION (1) | ||
| 283 | #define LIBIE_AQC_FW_LOG_MAX_RESOLUTION (128) | ||
| 284 | |||
| 285 | struct libie_aqc_fw_log { | ||
| 286 | u8 cmd_flags; | ||
| 287 | |||
| 288 | u8 rsp_flag; | ||
| 289 | __le16 fw_rt_msb; | ||
| 290 | union { | ||
| 291 | struct { | ||
| 292 | __le32 fw_rt_lsb; | ||
| 293 | } sync; | ||
| 294 | struct { | ||
| 295 | __le16 log_resolution; | ||
| 296 | __le16 mdl_cnt; | ||
| 297 | } cfg; | ||
| 298 | } ops; | ||
| 299 | __le32 addr_high; | ||
| 300 | __le32 addr_low; | ||
| 301 | }; | ||
| 302 | |||
| 303 | /* Response Buffer for: | ||
| 304 | * Set Firmware Logging Configuration (0xFF30) | ||
| 305 | * Query FW Logging (0xFF32) | ||
| 306 | */ | ||
| 307 | struct libie_aqc_fw_log_cfg_resp { | ||
| 308 | __le16 module_identifier; | ||
| 309 | u8 log_level; | ||
| 310 | u8 rsvd0; | ||
| 311 | }; | ||
| 312 | |||
| 225 | /** | 313 | /** |
| 226 | * struct libie_aq_desc - Admin Queue (AQ) descriptor | 314 | * struct libie_aq_desc - Admin Queue (AQ) descriptor |
| 227 | * @flags: LIBIE_AQ_FLAG_* flags | 315 | * @flags: LIBIE_AQ_FLAG_* flags |
| @@ -253,6 +341,7 @@ struct libie_aq_desc { · 25 unmodified lines | |||
| 253 | struct libie_aqc_driver_ver driver_ver; | 341 | struct libie_aqc_driver_ver driver_ver; |
| 254 | struct libie_aqc_req_res res_owner; | 342 | struct libie_aqc_req_res res_owner; |
| 255 | struct libie_aqc_list_caps get_cap; | 343 | struct libie_aqc_list_caps get_cap; |
| 344 | struct libie_aqc_fw_log fw_log; | ||
| 256 | } params; | 345 | } params; |
| 257 | }; | 346 | }; |
| 258 | LIBIE_CHECK_STRUCT_LEN(32, libie_aq_desc); | 347 | LIBIE_CHECK_STRUCT_LEN(32, libie_aq_desc); |