iPXE
Functions
ib_service.c File Reference

Infiniband service records. More...

#include <string.h>
#include <stdio.h>
#include <byteswap.h>
#include <ipxe/infiniband.h>
#include <ipxe/ib_mi.h>
#include <ipxe/ib_service.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
struct ib_mad_transactionib_create_service_madx (struct ib_device *ibdev, struct ib_mad_interface *mi, const char *name, struct ib_mad_transaction_operations *op)
 Create service record management transaction. More...
 

Detailed Description

Infiniband service records.

Definition in file ib_service.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ ib_create_service_madx()

struct ib_mad_transaction* ib_create_service_madx ( struct ib_device ibdev,
struct ib_mad_interface mi,
const char *  name,
struct ib_mad_transaction_operations op 
)

Create service record management transaction.

Parameters
ibdevInfiniband device
miManagement interface
nameService name
opManagement transaction operations
Return values
madxManagement transaction, or NULL on error

Definition at line 49 of file ib_service.c.

51  {
52  union ib_mad mad;
53  struct ib_mad_sa *sa = &mad.sa;
54  struct ib_service_record *svc = &sa->sa_data.service_record;
55 
56  /* Construct service record request */
57  memset ( sa, 0, sizeof ( *sa ) );
58  sa->mad_hdr.mgmt_class = IB_MGMT_CLASS_SUBN_ADM;
59  sa->mad_hdr.class_version = IB_SA_CLASS_VERSION;
60  sa->mad_hdr.method = IB_MGMT_METHOD_GET;
61  sa->mad_hdr.attr_id = htons ( IB_SA_ATTR_SERVICE_REC );
62  sa->sa_hdr.comp_mask[1] = htonl ( IB_SA_SERVICE_REC_NAME );
63  snprintf ( svc->name, sizeof ( svc->name ), "%s", name );
64 
65  /* Create management transaction */
66  return ib_create_madx ( ibdev, mi, &mad, NULL, op );
67 }
#define IB_SA_CLASS_VERSION
Definition: ib_mad.h:207
#define IB_MGMT_METHOD_GET
Definition: ib_mad.h:569
const char * name
Definition: ath9k_hw.c:1984
struct sockaddr sa
Definition: dns.c:68
char name[64]
Definition: ib_mad.h:233
#define htonl(value)
Definition: byteswap.h:133
struct ib_mad_transaction * ib_create_madx(struct ib_device *ibdev, struct ib_mad_interface *mi, union ib_mad *mad, struct ib_address_vector *av, struct ib_mad_transaction_operations *op)
Create management transaction.
Definition: ib_mi.c:287
struct ib_mad_sa sa
Definition: ib_mad.h:613
static uint16_t struct vmbus_xfer_pages_operations * op
Definition: netvsc.h:327
#define IB_SA_ATTR_SERVICE_REC
Definition: ib_mad.h:222
#define IB_MGMT_CLASS_SUBN_ADM
Definition: ib_mad.h:557
A management datagram.
Definition: ib_mad.h:610
#define IB_SA_SERVICE_REC_NAME
Definition: ib_mad.h:240
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition: vsprintf.c:382
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
A subnet administration MAD.
Definition: ib_mad.h:596
#define htons(value)
Definition: byteswap.h:135
union ib_mad mad
Definition: arbel.h:12
void * memset(void *dest, int character, size_t len) __nonnull

References htonl, htons, ib_create_madx(), IB_MGMT_CLASS_SUBN_ADM, IB_MGMT_METHOD_GET, IB_SA_ATTR_SERVICE_REC, IB_SA_CLASS_VERSION, IB_SA_SERVICE_REC_NAME, mad, memset(), ib_service_record::name, name, NULL, op, ib_mad::sa, sa, and snprintf().

Referenced by xsigo_discover().