@@ -7369,7 +7369,7 @@ lpfc_set_host_data(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox)
7369
7369
mbox->u.mqe.un.set_host_data.param_id = LPFC_SET_HOST_OS_DRIVER_VERSION;
7370
7370
mbox->u.mqe.un.set_host_data.param_len =
7371
7371
LPFC_HOST_OS_DRIVER_VERSION_SIZE;
7372
- snprintf(mbox->u.mqe.un.set_host_data.data,
7372
+ snprintf(mbox->u.mqe.un.set_host_data.un. data,
7373
7373
LPFC_HOST_OS_DRIVER_VERSION_SIZE,
7374
7374
"Linux %s v"LPFC_DRIVER_VERSION,
7375
7375
(phba->hba_flag & HBA_FCOE_MODE) ? "FCoE" : "FC");
@@ -7499,6 +7499,51 @@ static void lpfc_sli4_dip(struct lpfc_hba *phba)
7499
7499
}
7500
7500
}
7501
7501
7502
+ static int
7503
+ lpfc_set_host_tm(struct lpfc_hba *phba)
7504
+ {
7505
+ LPFC_MBOXQ_t *mboxq;
7506
+ uint32_t len, rc;
7507
+ struct timespec64 cur_time;
7508
+ struct tm broken;
7509
+ uint32_t month, day, year;
7510
+ uint32_t hour, minute, second;
7511
+ struct lpfc_mbx_set_host_date_time *tm;
7512
+
7513
+ mboxq = (LPFC_MBOXQ_t *)mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
7514
+ if (!mboxq)
7515
+ return -ENOMEM;
7516
+
7517
+ len = sizeof(struct lpfc_mbx_set_host_data) -
7518
+ sizeof(struct lpfc_sli4_cfg_mhdr);
7519
+ lpfc_sli4_config(phba, mboxq, LPFC_MBOX_SUBSYSTEM_COMMON,
7520
+ LPFC_MBOX_OPCODE_SET_HOST_DATA, len,
7521
+ LPFC_SLI4_MBX_EMBED);
7522
+
7523
+ mboxq->u.mqe.un.set_host_data.param_id = LPFC_SET_HOST_DATE_TIME;
7524
+ mboxq->u.mqe.un.set_host_data.param_len =
7525
+ sizeof(struct lpfc_mbx_set_host_date_time);
7526
+ tm = &mboxq->u.mqe.un.set_host_data.un.tm;
7527
+ ktime_get_real_ts64(&cur_time);
7528
+ time64_to_tm(cur_time.tv_sec, 0, &broken);
7529
+ month = broken.tm_mon + 1;
7530
+ day = broken.tm_mday;
7531
+ year = broken.tm_year - 100;
7532
+ hour = broken.tm_hour;
7533
+ minute = broken.tm_min;
7534
+ second = broken.tm_sec;
7535
+ bf_set(lpfc_mbx_set_host_month, tm, month);
7536
+ bf_set(lpfc_mbx_set_host_day, tm, day);
7537
+ bf_set(lpfc_mbx_set_host_year, tm, year);
7538
+ bf_set(lpfc_mbx_set_host_hour, tm, hour);
7539
+ bf_set(lpfc_mbx_set_host_min, tm, minute);
7540
+ bf_set(lpfc_mbx_set_host_sec, tm, second);
7541
+
7542
+ rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL);
7543
+ mempool_free(mboxq, phba->mbox_mem_pool);
7544
+ return rc;
7545
+ }
7546
+
7502
7547
/**
7503
7548
* lpfc_sli4_hba_setup - SLI4 device initialization PCI function
7504
7549
* @phba: Pointer to HBA context object.
@@ -7588,6 +7633,10 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
7588
7633
goto out_free_mbox;
7589
7634
}
7590
7635
7636
+ rc = lpfc_set_host_tm(phba);
7637
+ lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_INIT,
7638
+ "6468 Set host date / time: Status x%x:\n", rc);
7639
+
7591
7640
/*
7592
7641
* Continue initialization with default values even if driver failed
7593
7642
* to read FCoE param config regions, only read parameters if the
0 commit comments