33 #ifndef __ELXU_COMMON_H__
34 #define __ELXU_COMMON_H__
40 #define ELXU_VERSION STR_BE_MAJOR "." STR_BE_MINOR "." STR_BE_BUILD "." STR_BE_BRANCH
43 #define TRANSCEIVER_INFO_PAGE_SIZE 256
45 #if !defined(ARRAY_SIZE)
46 #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
49 #define ROUNDUP(x,y) ((((x) + ((y)-1)) / (y)) * (y))
53 return (uint32_t)(addr & 0xffffffffUL);
62 return (uint32_t)(addr >> 32);
68 typedef struct cmd_options_s {
95 #define LINKCFG_VALUE_NAME_MAX 256
97 #define LINKSPEED_VALUE_NAME_MAX 64
99 #define LINKTOPO_VALUE_NAME_MAX 16
117 extern void *
zmalloc (uint32_t len);
118 extern void zfree (
void *p);
121 extern int parse_wwn(
char *wwn_in, uint64_t *wwn_out);
123 extern void dump8 (
const char *label,
void *buffer, uint32_t bufferLength);
124 char *
hex_dump(uint8_t *value,
int size);
char * trimmed_string(uint8_t *string)
Trim trailing non-printable characters from a string.
int parse_wwn(char *wwn_in, uint64_t *wwn_out)
Parse a WWN from a string into a 64-bit value.
static uint32_t addr32_lo(uintptr_t addr)
void elxu_display_device_list(char *hostname)
Display the list of available devices.
elxu_device_t * os_build_device_list(char *path)
char * get_physical_numa_node(char *bus_addr)
Return the physical Numa Node location for an OCS port .
void os_close_device(elxu_device_t *device)
Close a device file.
int os_ioctl_device(elxu_device_t *device, int req, void *arg)
Send an ioctl to an open device.
device name specifier This structure is used to describe the type and name of the device ioctl connec...
void * zmalloc(uint32_t len)
Allocates and zeroes memory to be used.
char * format_wwn(uint64_t wwn_in)
Format a 64-bit WWN for printing.
void zfree(void *p)
Frees memory that has been allocated.
#define LINKCFG_VALUE_NAME_MAX
#define LINKSPEED_VALUE_NAME_MAX
char * decode_entry_type(uint32_t entry_type)
Return the name of a UFI entry type.
void elxu_get_connection_info(elxu_device_t *device)
Print iSCSI connection info for the given device.
#define LINKTOPO_VALUE_NAME_MAX
static uint32_t addr32_hi(uintptr_t addr)
elxu_device_t * os_open_device(elxu_device_name_t *devname)
Open a device file.
void dump8(const char *label, void *buffer, uint32_t bufferLength)
Print a buffer in hexadecimal and ASCII.
elxu_device_t * os_build_device_list_uspace(char *hostname)
char * hex_dump(uint8_t *value, int size)
Display a buffer in hexadecimal.
char * get_numa_node_map(uint32_t device_port)
Return a string of cpu to numa node mapping .
void elxu_hba_list_info(elxu_device_t *device_p)
Displays HBA List information.
int parse_arguments(int argc, char **argv, cmd_options_t *options, int openflag, int expected_nonargs)
Parse command line arguments.
int os_remove_device(elxu_device_t *device)