summaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/infiniband/arbel.c12
-rw-r--r--src/drivers/infiniband/hermon.c6
-rw-r--r--src/drivers/infiniband/linda.c17
-rw-r--r--src/drivers/infiniband/qib7322.c24
-rw-r--r--src/drivers/net/ipoib.c50
5 files changed, 52 insertions, 57 deletions
diff --git a/src/drivers/infiniband/arbel.c b/src/drivers/infiniband/arbel.c
index 5937c5249..129ec574e 100644
--- a/src/drivers/infiniband/arbel.c
+++ b/src/drivers/infiniband/arbel.c
@@ -396,7 +396,7 @@ arbel_cmd_write_mgm ( struct arbel *arbel, unsigned int index,
}
static inline int
-arbel_cmd_mgid_hash ( struct arbel *arbel, const struct ib_gid *gid,
+arbel_cmd_mgid_hash ( struct arbel *arbel, const union ib_gid *gid,
struct arbelprm_mgm_hash *hash ) {
return arbel_cmd ( arbel,
ARBEL_HCR_INOUT_CMD ( ARBEL_HCR_MGID_HASH,
@@ -998,8 +998,8 @@ static void arbel_ring_doorbell ( struct arbel *arbel,
}
/** GID used for GID-less send work queue entries */
-static const struct ib_gid arbel_no_gid = {
- { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0 } }
+static const union ib_gid arbel_no_gid = {
+ .bytes = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0 },
};
/**
@@ -1023,7 +1023,7 @@ static int arbel_post_send ( struct ib_device *ibdev,
struct arbelprm_ud_send_wqe *wqe;
struct arbelprm_qp_db_record *qp_db_rec;
union arbelprm_doorbell_register db_reg;
- const struct ib_gid *gid;
+ const union ib_gid *gid;
unsigned int wqe_idx_mask;
size_t nds;
@@ -1565,7 +1565,7 @@ static void arbel_close ( struct ib_device *ibdev ) {
*/
static int arbel_mcast_attach ( struct ib_device *ibdev,
struct ib_queue_pair *qp,
- struct ib_gid *gid ) {
+ union ib_gid *gid ) {
struct arbel *arbel = ib_get_drvdata ( ibdev );
struct arbelprm_mgm_hash hash;
struct arbelprm_mgm_entry mgm;
@@ -1620,7 +1620,7 @@ static int arbel_mcast_attach ( struct ib_device *ibdev,
*/
static void arbel_mcast_detach ( struct ib_device *ibdev,
struct ib_queue_pair *qp __unused,
- struct ib_gid *gid ) {
+ union ib_gid *gid ) {
struct arbel *arbel = ib_get_drvdata ( ibdev );
struct arbelprm_mgm_hash hash;
struct arbelprm_mgm_entry mgm;
diff --git a/src/drivers/infiniband/hermon.c b/src/drivers/infiniband/hermon.c
index f074386ff..8b5c2487c 100644
--- a/src/drivers/infiniband/hermon.c
+++ b/src/drivers/infiniband/hermon.c
@@ -474,7 +474,7 @@ hermon_cmd_write_mcg ( struct hermon *hermon, unsigned int index,
}
static inline int
-hermon_cmd_mgid_hash ( struct hermon *hermon, const struct ib_gid *gid,
+hermon_cmd_mgid_hash ( struct hermon *hermon, const union ib_gid *gid,
struct hermonprm_mgm_hash *hash ) {
return hermon_cmd ( hermon,
HERMON_HCR_INOUT_CMD ( HERMON_HCR_MGID_HASH,
@@ -2012,7 +2012,7 @@ static int hermon_inform_sma ( struct ib_device *ibdev,
*/
static int hermon_mcast_attach ( struct ib_device *ibdev,
struct ib_queue_pair *qp,
- struct ib_gid *gid ) {
+ union ib_gid *gid ) {
struct hermon *hermon = ib_get_drvdata ( ibdev );
struct hermonprm_mgm_hash hash;
struct hermonprm_mcg_entry mcg;
@@ -2066,7 +2066,7 @@ static int hermon_mcast_attach ( struct ib_device *ibdev,
*/
static void hermon_mcast_detach ( struct ib_device *ibdev,
struct ib_queue_pair *qp __unused,
- struct ib_gid *gid ) {
+ union ib_gid *gid ) {
struct hermon *hermon = ib_get_drvdata ( ibdev );
struct hermonprm_mgm_hash hash;
struct hermonprm_mcg_entry mcg;
diff --git a/src/drivers/infiniband/linda.c b/src/drivers/infiniband/linda.c
index 83d473c7f..12a09a047 100644
--- a/src/drivers/infiniband/linda.c
+++ b/src/drivers/infiniband/linda.c
@@ -1456,7 +1456,7 @@ static void linda_close ( struct ib_device *ibdev ) {
*/
static int linda_mcast_attach ( struct ib_device *ibdev,
struct ib_queue_pair *qp,
- struct ib_gid *gid ) {
+ union ib_gid *gid ) {
struct linda *linda = ib_get_drvdata ( ibdev );
( void ) linda;
@@ -1474,7 +1474,7 @@ static int linda_mcast_attach ( struct ib_device *ibdev,
*/
static void linda_mcast_detach ( struct ib_device *ibdev,
struct ib_queue_pair *qp,
- struct ib_gid *gid ) {
+ union ib_gid *gid ) {
struct linda *linda = ib_get_drvdata ( ibdev );
( void ) linda;
@@ -1631,22 +1631,19 @@ static int linda_init_i2c ( struct linda *linda ) {
* @v guid GUID to fill in
* @ret rc Return status code
*/
-static int linda_read_eeprom ( struct linda *linda,
- struct ib_gid_half *guid ) {
+static int linda_read_eeprom ( struct linda *linda, union ib_guid *guid ) {
struct i2c_interface *i2c = &linda->i2c.i2c;
int rc;
/* Read GUID */
if ( ( rc = i2c->read ( i2c, &linda->eeprom, LINDA_EEPROM_GUID_OFFSET,
- guid->u.bytes, sizeof ( *guid ) ) ) != 0 ) {
+ guid->bytes, sizeof ( *guid ) ) ) != 0 ) {
DBGC ( linda, "Linda %p could not read GUID: %s\n",
linda, strerror ( rc ) );
return rc;
}
- DBGC2 ( linda, "Linda %p has GUID %02x:%02x:%02x:%02x:%02x:%02x:"
- "%02x:%02x\n", linda, guid->u.bytes[0], guid->u.bytes[1],
- guid->u.bytes[2], guid->u.bytes[3], guid->u.bytes[4],
- guid->u.bytes[5], guid->u.bytes[6], guid->u.bytes[7] );
+ DBGC2 ( linda, "Linda %p has GUID " IB_GUID_FMT "\n",
+ linda, IB_GUID_ARGS ( guid ) );
/* Read serial number (debug only) */
if ( DBG_LOG ) {
@@ -2367,7 +2364,7 @@ static int linda_probe ( struct pci_device *pci,
goto err_init_i2c;
/* Read EEPROM parameters */
- if ( ( rc = linda_read_eeprom ( linda, &ibdev->gid.u.half[1] ) ) != 0 )
+ if ( ( rc = linda_read_eeprom ( linda, &ibdev->gid.s.guid ) ) != 0 )
goto err_read_eeprom;
/* Initialise send datapath */
diff --git a/src/drivers/infiniband/qib7322.c b/src/drivers/infiniband/qib7322.c
index e8b41a47c..b1902cfa9 100644
--- a/src/drivers/infiniband/qib7322.c
+++ b/src/drivers/infiniband/qib7322.c
@@ -118,7 +118,7 @@ struct qib7322 {
struct i2c_device eeprom;
/** Base GUID */
- struct ib_gid_half guid;
+ union ib_guid guid;
/** Infiniband devices */
struct ib_device *ibdev[QIB7322_MAX_PORTS];
};
@@ -1770,7 +1770,7 @@ static void qib7322_close ( struct ib_device *ibdev ) {
*/
static int qib7322_mcast_attach ( struct ib_device *ibdev,
struct ib_queue_pair *qp,
- struct ib_gid *gid ) {
+ union ib_gid *gid ) {
struct qib7322 *qib7322 = ib_get_drvdata ( ibdev );
( void ) qib7322;
@@ -1788,7 +1788,7 @@ static int qib7322_mcast_attach ( struct ib_device *ibdev,
*/
static void qib7322_mcast_detach ( struct ib_device *ibdev,
struct ib_queue_pair *qp,
- struct ib_gid *gid ) {
+ union ib_gid *gid ) {
struct qib7322 *qib7322 = ib_get_drvdata ( ibdev );
( void ) qib7322;
@@ -1946,21 +1946,19 @@ static int qib7322_init_i2c ( struct qib7322 *qib7322 ) {
*/
static int qib7322_read_eeprom ( struct qib7322 *qib7322 ) {
struct i2c_interface *i2c = &qib7322->i2c.i2c;
- struct ib_gid_half *guid = &qib7322->guid;
+ union ib_guid *guid = &qib7322->guid;
int rc;
/* Read GUID */
if ( ( rc = i2c->read ( i2c, &qib7322->eeprom,
- QIB7322_EEPROM_GUID_OFFSET, guid->u.bytes,
+ QIB7322_EEPROM_GUID_OFFSET, guid->bytes,
sizeof ( *guid ) ) ) != 0 ) {
DBGC ( qib7322, "QIB7322 %p could not read GUID: %s\n",
qib7322, strerror ( rc ) );
return rc;
}
- DBGC2 ( qib7322, "QIB7322 %p has GUID %02x:%02x:%02x:%02x:%02x:%02x:"
- "%02x:%02x\n", qib7322, guid->u.bytes[0], guid->u.bytes[1],
- guid->u.bytes[2], guid->u.bytes[3], guid->u.bytes[4],
- guid->u.bytes[5], guid->u.bytes[6], guid->u.bytes[7] );
+ DBGC2 ( qib7322, "QIB7322 %p has GUID " IB_GUID_FMT "\n",
+ qib7322, IB_GUID_ARGS ( guid ) );
/* Read serial number (debug only) */
if ( DBG_LOG ) {
@@ -2359,10 +2357,10 @@ static int qib7322_probe ( struct pci_device *pci,
IB_LINK_WIDTH_4X; /* 1x does not work */
ibdev->link_speed_enabled = ibdev->link_speed_supported =
IB_LINK_SPEED_SDR; /* to avoid need for link tuning */
- memcpy ( &ibdev->gid.u.half[1], &qib7322->guid,
- sizeof ( ibdev->gid.u.half[1] ) );
- assert ( ( ibdev->gid.u.half[1].u.bytes[7] & i ) == 0 );
- ibdev->gid.u.half[1].u.bytes[7] |= i;
+ memcpy ( &ibdev->gid.s.guid, &qib7322->guid,
+ sizeof ( ibdev->gid.s.guid ) );
+ assert ( ( ibdev->gid.s.guid.bytes[7] & i ) == 0 );
+ ibdev->gid.s.guid.bytes[7] |= i;
ib_set_drvdata ( ibdev, qib7322 );
}
diff --git a/src/drivers/net/ipoib.c b/src/drivers/net/ipoib.c
index 82d7ca999..52ac5f03a 100644
--- a/src/drivers/net/ipoib.c
+++ b/src/drivers/net/ipoib.c
@@ -72,8 +72,8 @@ struct ipoib_device {
/** Broadcast IPoIB address */
static struct ipoib_mac ipoib_broadcast = {
.flags__qpn = htonl ( IB_QPN_BROADCAST ),
- .gid.u.bytes = { 0xff, 0x12, 0x40, 0x1b, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff },
+ .gid.bytes = { 0xff, 0x12, 0x40, 0x1b, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff },
};
/** Link status for "broadcast join in progress" */
@@ -266,11 +266,11 @@ static int ipoib_pull ( struct net_device *netdev,
* @v ll_addr Link-layer address
*/
static void ipoib_init_addr ( const void *hw_addr, void *ll_addr ) {
- const struct ib_gid_half *guid = hw_addr;
+ const union ib_guid *guid = hw_addr;
struct ipoib_mac *mac = ll_addr;
memset ( mac, 0, sizeof ( *mac ) );
- memcpy ( &mac->gid.u.half[1], guid, sizeof ( mac->gid.u.half[1] ) );
+ memcpy ( &mac->gid.s.guid, guid, sizeof ( mac->gid.s.guid ) );
}
/**
@@ -284,10 +284,10 @@ const char * ipoib_ntoa ( const void *ll_addr ) {
const struct ipoib_mac *mac = ll_addr;
snprintf ( buf, sizeof ( buf ), "%08x:%08x:%08x:%08x:%08x",
- htonl ( mac->flags__qpn ), htonl ( mac->gid.u.dwords[0] ),
- htonl ( mac->gid.u.dwords[1] ),
- htonl ( mac->gid.u.dwords[2] ),
- htonl ( mac->gid.u.dwords[3] ) );
+ htonl ( mac->flags__qpn ), htonl ( mac->gid.dwords[0] ),
+ htonl ( mac->gid.dwords[1] ),
+ htonl ( mac->gid.dwords[2] ),
+ htonl ( mac->gid.dwords[3] ) );
return buf;
}
@@ -312,14 +312,14 @@ static int ipoib_mc_hash ( unsigned int af __unused,
* @v ll_addr Link-layer address
* @v eth_addr Ethernet-compatible address to fill in
*/
-static int ipoib_mlx_eth_addr ( const struct ib_gid_half *guid,
+static int ipoib_mlx_eth_addr ( const union ib_guid *guid,
uint8_t *eth_addr ) {
- eth_addr[0] = ( ( guid->u.bytes[3] == 2 ) ? 0x00 : 0x02 );
- eth_addr[1] = guid->u.bytes[1];
- eth_addr[2] = guid->u.bytes[2];
- eth_addr[3] = guid->u.bytes[5];
- eth_addr[4] = guid->u.bytes[6];
- eth_addr[5] = guid->u.bytes[7];
+ eth_addr[0] = ( ( guid->bytes[3] == 2 ) ? 0x00 : 0x02 );
+ eth_addr[1] = guid->bytes[1];
+ eth_addr[2] = guid->bytes[2];
+ eth_addr[3] = guid->bytes[5];
+ eth_addr[4] = guid->bytes[6];
+ eth_addr[5] = guid->bytes[7];
return 0;
}
@@ -330,7 +330,7 @@ struct ipoib_eth_addr_handler {
/** GUID byte 2 */
uint8_t byte2;
/** Handler */
- int ( * eth_addr ) ( const struct ib_gid_half *guid,
+ int ( * eth_addr ) ( const union ib_guid *guid,
uint8_t *eth_addr );
};
@@ -347,15 +347,15 @@ static struct ipoib_eth_addr_handler ipoib_eth_addr_handlers[] = {
*/
static int ipoib_eth_addr ( const void *ll_addr, void *eth_addr ) {
const struct ipoib_mac *ipoib_addr = ll_addr;
- const struct ib_gid_half *guid = &ipoib_addr->gid.u.half[1];
+ const union ib_guid *guid = &ipoib_addr->gid.s.guid;
struct ipoib_eth_addr_handler *handler;
unsigned int i;
for ( i = 0 ; i < ( sizeof ( ipoib_eth_addr_handlers ) /
sizeof ( ipoib_eth_addr_handlers[0] ) ) ; i++ ) {
handler = &ipoib_eth_addr_handlers[i];
- if ( ( handler->byte1 == guid->u.bytes[1] ) &&
- ( handler->byte2 == guid->u.bytes[2] ) ) {
+ if ( ( handler->byte1 == guid->bytes[1] ) &&
+ ( handler->byte2 == guid->bytes[2] ) ) {
return handler->eth_addr ( guid, eth_addr );
}
}
@@ -366,7 +366,7 @@ static int ipoib_eth_addr ( const void *ll_addr, void *eth_addr ) {
struct ll_protocol ipoib_protocol __ll_protocol = {
.name = "IPoIB",
.ll_proto = htons ( ARPHRD_INFINIBAND ),
- .hw_addr_len = sizeof ( struct ib_gid_half ),
+ .hw_addr_len = sizeof ( union ib_guid ),
.ll_addr_len = IPOIB_ALEN,
.ll_header_len = IPOIB_HLEN,
.push = ipoib_push,
@@ -612,11 +612,11 @@ static void ipoib_link_state_changed ( struct ib_device *ibdev ) {
ipoib_leave_broadcast_group ( ipoib );
/* Update MAC address based on potentially-new GID prefix */
- memcpy ( &mac->gid.u.half[0], &ibdev->gid.u.half[0],
- sizeof ( mac->gid.u.half[0] ) );
+ memcpy ( &mac->gid.s.prefix, &ibdev->gid.s.prefix,
+ sizeof ( mac->gid.s.prefix ) );
/* Update broadcast GID based on potentially-new partition key */
- ipoib->broadcast.gid.u.words[2] =
+ ipoib->broadcast.gid.words[2] =
htons ( ibdev->pkey | IB_PKEY_FULL );
/* Set net device link state to reflect Infiniband link state */
@@ -750,8 +750,8 @@ static int ipoib_probe ( struct ib_device *ibdev ) {
ipoib->ibdev = ibdev;
/* Extract hardware address */
- memcpy ( netdev->hw_addr, &ibdev->gid.u.half[1],
- sizeof ( ibdev->gid.u.half[1] ) );
+ memcpy ( netdev->hw_addr, &ibdev->gid.s.guid,
+ sizeof ( ibdev->gid.s.guid ) );
/* Set default broadcast address */
memcpy ( &ipoib->broadcast, &ipoib_broadcast,