[infiniband] Match GID/GUID terminology as used in the IBA

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2010-09-15 19:25:05 +01:00
parent 3ea3c846d8
commit 52e54a8c69
22 changed files with 186 additions and 205 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 */

View File

@@ -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 );
}