1313#include <linux/configfs.h>
1414
1515static struct tsm_provider {
16- const struct tsm_ops * ops ;
16+ const struct tsm_report_ops * ops ;
1717 void * data ;
1818 atomic_t count ;
1919} provider ;
@@ -103,7 +103,7 @@ static ssize_t tsm_report_privlevel_store(struct config_item *cfg,
103103 * SEV-SNP GHCB) and a minimum of a TSM selected floor value no less
104104 * than 0.
105105 */
106- if (provider .ops -> privlevel_floor > val || val > TSM_PRIVLEVEL_MAX )
106+ if (provider .ops -> privlevel_floor > val || val > TSM_REPORT_PRIVLEVEL_MAX )
107107 return - EINVAL ;
108108
109109 rc = try_advance_write_generation (report );
@@ -210,7 +210,7 @@ static ssize_t tsm_report_inblob_write(struct config_item *cfg,
210210 memcpy (report -> desc .inblob , buf , count );
211211 return count ;
212212}
213- CONFIGFS_BIN_ATTR_WO (tsm_report_ , inblob , NULL , TSM_INBLOB_MAX );
213+ CONFIGFS_BIN_ATTR_WO (tsm_report_ , inblob , NULL , TSM_REPORT_INBLOB_MAX );
214214
215215static ssize_t tsm_report_generation_show (struct config_item * cfg , char * buf )
216216{
@@ -283,7 +283,7 @@ static ssize_t tsm_report_read(struct tsm_report *report, void *buf,
283283 size_t count , enum tsm_data_select select )
284284{
285285 struct tsm_report_state * state = to_state (report );
286- const struct tsm_ops * ops ;
286+ const struct tsm_report_ops * ops ;
287287 ssize_t rc ;
288288
289289 /* try to read from the existing report if present and valid... */
@@ -325,7 +325,7 @@ static ssize_t tsm_report_outblob_read(struct config_item *cfg, void *buf,
325325
326326 return tsm_report_read (report , buf , count , TSM_REPORT );
327327}
328- CONFIGFS_BIN_ATTR_RO (tsm_report_ , outblob , NULL , TSM_OUTBLOB_MAX );
328+ CONFIGFS_BIN_ATTR_RO (tsm_report_ , outblob , NULL , TSM_REPORT_OUTBLOB_MAX );
329329
330330static ssize_t tsm_report_auxblob_read (struct config_item * cfg , void * buf ,
331331 size_t count )
@@ -334,7 +334,7 @@ static ssize_t tsm_report_auxblob_read(struct config_item *cfg, void *buf,
334334
335335 return tsm_report_read (report , buf , count , TSM_CERTS );
336336}
337- CONFIGFS_BIN_ATTR_RO (tsm_report_ , auxblob , NULL , TSM_OUTBLOB_MAX );
337+ CONFIGFS_BIN_ATTR_RO (tsm_report_ , auxblob , NULL , TSM_REPORT_OUTBLOB_MAX );
338338
339339static ssize_t tsm_report_manifestblob_read (struct config_item * cfg , void * buf ,
340340 size_t count )
@@ -343,7 +343,7 @@ static ssize_t tsm_report_manifestblob_read(struct config_item *cfg, void *buf,
343343
344344 return tsm_report_read (report , buf , count , TSM_MANIFEST );
345345}
346- CONFIGFS_BIN_ATTR_RO (tsm_report_ , manifestblob , NULL , TSM_OUTBLOB_MAX );
346+ CONFIGFS_BIN_ATTR_RO (tsm_report_ , manifestblob , NULL , TSM_REPORT_OUTBLOB_MAX );
347347
348348static struct configfs_attribute * tsm_report_attrs [] = {
349349 [TSM_REPORT_GENERATION ] = & tsm_report_attr_generation ,
@@ -467,9 +467,9 @@ static struct configfs_subsystem tsm_configfs = {
467467 .su_mutex = __MUTEX_INITIALIZER (tsm_configfs .su_mutex ),
468468};
469469
470- int tsm_register (const struct tsm_ops * ops , void * priv )
470+ int tsm_report_register (const struct tsm_report_ops * ops , void * priv )
471471{
472- const struct tsm_ops * conflict ;
472+ const struct tsm_report_ops * conflict ;
473473
474474 guard (rwsem_write )(& tsm_rwsem );
475475 conflict = provider .ops ;
@@ -487,9 +487,9 @@ int tsm_register(const struct tsm_ops *ops, void *priv)
487487 provider .data = priv ;
488488 return 0 ;
489489}
490- EXPORT_SYMBOL_GPL (tsm_register );
490+ EXPORT_SYMBOL_GPL (tsm_report_register );
491491
492- int tsm_unregister (const struct tsm_ops * ops )
492+ int tsm_report_unregister (const struct tsm_report_ops * ops )
493493{
494494 guard (rwsem_write )(& tsm_rwsem );
495495 if (ops != provider .ops )
@@ -501,11 +501,11 @@ int tsm_unregister(const struct tsm_ops *ops)
501501 provider .data = NULL ;
502502 return 0 ;
503503}
504- EXPORT_SYMBOL_GPL (tsm_unregister );
504+ EXPORT_SYMBOL_GPL (tsm_report_unregister );
505505
506506static struct config_group * tsm_report_group ;
507507
508- static int __init tsm_init (void )
508+ static int __init tsm_report_init (void )
509509{
510510 struct config_group * root = & tsm_configfs .su_group ;
511511 struct config_group * tsm ;
@@ -526,14 +526,14 @@ static int __init tsm_init(void)
526526
527527 return 0 ;
528528}
529- module_init (tsm_init );
529+ module_init (tsm_report_init );
530530
531- static void __exit tsm_exit (void )
531+ static void __exit tsm_report_exit (void )
532532{
533533 configfs_unregister_default_group (tsm_report_group );
534534 configfs_unregister_subsystem (& tsm_configfs );
535535}
536- module_exit (tsm_exit );
536+ module_exit (tsm_report_exit );
537537
538538MODULE_LICENSE ("GPL" );
539539MODULE_DESCRIPTION ("Provide Trusted Security Module attestation reports via configfs" );
0 commit comments