nfp: add nfp_cpp_area_size() accessor
Allow users outside of core reading area sizes. This was not needed previously because whatever entity created the area would usually know what size it asked for. The nfp_rtsym_map() helper, however, will allocate the area based on the size of an RT-symbol with given name. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
parent
7310c23328
commit
a351ab565c
2 changed files with 12 additions and 0 deletions
|
@ -242,6 +242,7 @@ int nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
|
|||
void *buffer, size_t length);
|
||||
int nfp_cpp_area_write(struct nfp_cpp_area *area, unsigned long offset,
|
||||
const void *buffer, size_t length);
|
||||
size_t nfp_cpp_area_size(struct nfp_cpp_area *area);
|
||||
const char *nfp_cpp_area_name(struct nfp_cpp_area *cpp_area);
|
||||
void *nfp_cpp_area_priv(struct nfp_cpp_area *cpp_area);
|
||||
struct nfp_cpp *nfp_cpp_area_cpp(struct nfp_cpp_area *cpp_area);
|
||||
|
|
|
@ -567,6 +567,17 @@ int nfp_cpp_area_write(struct nfp_cpp_area *area,
|
|||
return area->cpp->op->area_write(area, kernel_vaddr, offset, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* nfp_cpp_area_size() - return size of a CPP area
|
||||
* @cpp_area: CPP area handle
|
||||
*
|
||||
* Return: Size of the area
|
||||
*/
|
||||
size_t nfp_cpp_area_size(struct nfp_cpp_area *cpp_area)
|
||||
{
|
||||
return cpp_area->size;
|
||||
}
|
||||
|
||||
/**
|
||||
* nfp_cpp_area_name() - return name of a CPP area
|
||||
* @cpp_area: CPP area handle
|
||||
|
|
Loading…
Reference in a new issue