diff options
author | Evan Lojewski <github@meklort.com> | 2019-02-09 18:09:33 -0700 |
---|---|---|
committer | Evan Lojewski <github@meklort.com> | 2019-02-09 18:09:33 -0700 |
commit | 3cfa5c59e6a69106fefdbd35f39ab1179a49959f (patch) | |
tree | 12937af676b44775c03b95c56b637aebc06fa36a /libs/VPD/include/vpd.h | |
parent | c9ff2c0b1ca53e3c4a199da7e4804499c88bdbae (diff) | |
download | bcm5719-ortega-3cfa5c59e6a69106fefdbd35f39ab1179a49959f.tar.gz bcm5719-ortega-3cfa5c59e6a69106fefdbd35f39ab1179a49959f.zip |
Do a manual clang-format run
Diffstat (limited to 'libs/VPD/include/vpd.h')
-rw-r--r-- | libs/VPD/include/vpd.h | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/libs/VPD/include/vpd.h b/libs/VPD/include/vpd.h index 3b266f7..c7c85ea 100644 --- a/libs/VPD/include/vpd.h +++ b/libs/VPD/include/vpd.h @@ -2,7 +2,7 @@ /// /// @file vpd.c /// -/// @project +/// @project /// /// @brief VPD Support Routines /// @@ -42,9 +42,9 @@ /// @endcond //////////////////////////////////////////////////////////////////////////////// -#include <stdint.h> #include <stdbool.h> #include <stddef.h> +#include <stdint.h> #define VPD_DATA_TYPE_SMALL (0x00) #define VPD_DATA_TYPE_LARGE (0x01) @@ -53,29 +53,31 @@ #define VPD_TAG_VPD_R (0x10) #define VPD_TAG_VPD_W (0x11) typedef union { - struct { - uint8_t bytes:3; - uint8_t tag:4; - uint8_t type:1; + struct + { + uint8_t bytes : 3; + uint8_t tag : 4; + uint8_t type : 1; } small; - struct { - uint8_t tag:7; - uint8_t type:1; + struct + { + uint8_t tag : 7; + uint8_t type : 1; } large; uint8_t data; } vpd_resource_typet_t; -typedef struct { - uint16_t name; - uint8_t length; - uint8_t data; +typedef struct +{ + uint16_t name; + uint8_t length; + uint8_t data; } __attribute__((packed)) vpd_field_t; typedef union { uint8_t bytes[0x100]; } vpd_t; - #define VPD_PRODUCT_NAME "PN" #define VPD_ENGINEERING_CHANGE "EC" #define VPD_SERIAL_NUMBER "SN" @@ -83,12 +85,12 @@ typedef union { #define VPD_VENDOR_SPECIFIC_0 "V0" #define VPD_CHECKSUM "RV" -const char* vpd_get_field_name(uint16_t field); - - -uint8_t* vpd_get_identifier(uint8_t *buffer, size_t *len); -uint8_t* vpd_get_resource_by_name(uint8_t* buffer, size_t* len, uint16_t name); -uint8_t* vpd_get_resource_by_index(uint8_t* buffer, size_t* len, uint16_t* name, size_t index); -bool vpd_set_resource(uint8_t* buffer, size_t len, uint16_t resource, uint8_t* add_data, size_t add_len); -bool vpd_is_valid(uint8_t* buffer, size_t len); +const char *vpd_get_field_name(uint16_t field); +uint8_t *vpd_get_identifier(uint8_t *buffer, size_t *len); +uint8_t *vpd_get_resource_by_name(uint8_t *buffer, size_t *len, uint16_t name); +uint8_t *vpd_get_resource_by_index(uint8_t *buffer, size_t *len, uint16_t *name, + size_t index); +bool vpd_set_resource(uint8_t *buffer, size_t len, uint16_t resource, + uint8_t *add_data, size_t add_len); +bool vpd_is_valid(uint8_t *buffer, size_t len); |