Commit c22cd7cb authored by Adam Wujek's avatar Adam Wujek 💬

wrs-arch: update hal_shmem.h and sfp_lib.h

There is a need to update sfp_lib.h since new field vendor_name in
structure shw_sfp_caldata was added. That changes position of other fields in
shmem.
hal_shmem.h was updated because HAL's shmem version was changes.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 14583c20
......@@ -103,22 +103,13 @@ struct hal_port_state {
};
/* This is the overall structure stored in shared memory */
#define HAL_SHMEM_VERSION 4 /* Version 4 because of new fields in struct
* hal_port_state */
#define HAL_SHMEM_VERSION 5 /* Version 5 because of new field vendor_name in
* struct shw_sfp_caldata */
struct hal_shmem_header {
int nports;
struct hal_port_state *ports;
};
/*
* The following functions were in userspace/wrsw_hal/hal_ports.c,
* and are used to marshall data for the RPC format. Now that we
* offer shared memory, it is the caller who must convert data to
* the expected format (which remains the RPC one as I write this).
*/
struct hal_port_state *hal_port_lookup(struct hal_port_state *ports,
const char *name);
static inline int state_up(int state)
{
return (state != HAL_PORT_STATE_LINK_DOWN
......@@ -126,7 +117,8 @@ static inline int state_up(int state)
}
static inline struct hal_port_state *hal_lookup_port(
struct hal_port_state *ports, int nports, char *name)
struct hal_port_state *ports, int nports,
const char *name)
{
int i;
......
......@@ -22,12 +22,13 @@
#define SFP_FLAG_DEVICE_DATA (1 << 1)
struct shw_sfp_caldata {
int flags;
uint32_t flags;
/*
* Part number used to identify it. Serial number because we
* may specify per-specimen delays, but it is not used at this
* point in time
*/
char vendor_name[16];
char part_num[16];
char vendor_serial[16];
/* Callibration data */
......@@ -103,7 +104,8 @@ int shw_sfp_read_db(void);
int shw_sfp_read_verify_header(int num, struct shw_sfp_header *head);
/* return NULL if no data found */
struct shw_sfp_caldata *shw_sfp_get_cal_data(int num);
struct shw_sfp_caldata *shw_sfp_get_cal_data(int num,
struct shw_sfp_header *head);
/* Read and verify the header all at once. returns -1 on failure */
int shw_sfp_read_verify_header(int num, struct shw_sfp_header *head);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment