 /* * Set the full membership bit, so that we join the right * broadcast group, etc. */ priv->pkey |= 0x8000; 
static struct net_device *ipoib_add_port(const char *format,					 struct ib_device *hca, u8 port){	struct ipoib_dev_priv *priv;	int result = -ENOMEM;	priv = ipoib_intf_alloc(format);	if (!priv)		goto alloc_mem_failed;	SET_NETDEV_DEV(priv->dev, hca->dma_device);	result = ib_query_pkey(hca, port, 0, &priv->pkey);	if (result) {		printk(KERN_WARNING "%s: ib_query_pkey port %d failed (ret = %d)\n",		       hca->name, port, result);		goto alloc_mem_failed;	}	priv->dev->broadcast[8] = priv->pkey >> 8;	priv->dev->broadcast[9] = priv->pkey & 0xff;	result = ib_query_gid(hca, port, 0, &priv->local_gid);	if (result) {		printk(KERN_WARNING "%s: ib_query_gid port %d failed (ret = %d)\n",		       hca->name, port, result);		goto alloc_mem_failed;	} else		memcpy(priv->dev->dev_addr + 4, priv->local_gid.raw, sizeof (union ib_gid));	result = ipoib_dev_init(priv->dev, hca, port);	if (result < 0) {		printk(KERN_WARNING "%s: failed to initialize port %d (ret = %d)\n",		       hca->name, port, result);		goto device_init_failed;	}	INIT_IB_EVENT_HANDLER(&priv->event_handler,			      priv->ca, ipoib_event);	result = ib_register_event_handler(&priv->event_handler);	if (result < 0) {		printk(KERN_WARNING "%s: ib_register_event_handler failed for "		       "port %d (ret = %d)\n",		       hca->name, port, result);		goto event_failed;	}	result = register_netdev(priv->dev);	if (result) {		printk(KERN_WARNING "%s: couldn't register ipoib port %d; error %d\n",		       hca->name, port, result);		goto register_failed;	}	if (ipoib_create_debug_file(priv->dev))		goto debug_failed;	if (ipoib_add_pkey_attr(priv->dev))		goto sysfs_failed;	if (class_device_create_file(&priv->dev->class_dev,				     &class_device_attr_create_child))		goto sysfs_failed;	if (class_device_create_file(&priv->dev->class_dev,				     &class_device_attr_delete_child))		goto sysfs_failed;	return priv->dev;sysfs_failed:	ipoib_delete_debug_file(priv->dev);debug_failed:	unregister_netdev(priv->dev);register_failed:	ib_unregister_event_handler(&priv->event_handler);event_failed:	ipoib_dev_cleanup(priv->dev);device_init_failed:	free_netdev(priv->dev);alloc_mem_failed:	return ERR_PTR(result);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4ce059378c04b40c2e9f658b1c6a2e9078b85c7c/ipoib_main.c/clean/drivers/infiniband/ulp/ipoib/ipoib_main.c