cache.c (8faea9fd4a3914f12cd343e10810ec5f4215ddd6) | cache.c (c2261dd76b549754c14c8ac7cadadd0993b182d6) |
---|---|
1/* 2 * Copyright (c) 2004 Topspin Communications. All rights reserved. 3 * Copyright (c) 2005 Intel Corporation. All rights reserved. 4 * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. 5 * Copyright (c) 2005 Voltaire, Inc. All rights reserved. 6 * 7 * This software is available to you under a choice of one of two 8 * licenses. You may choose to be licensed under the terms of the GNU --- 533 unchanged lines hidden (view full) --- 542 543int ib_cache_gid_add(struct ib_device *ib_dev, u8 port, 544 union ib_gid *gid, struct ib_gid_attr *attr) 545{ 546 struct net_device *idev; 547 unsigned long mask; 548 int ret; 549 | 1/* 2 * Copyright (c) 2004 Topspin Communications. All rights reserved. 3 * Copyright (c) 2005 Intel Corporation. All rights reserved. 4 * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. 5 * Copyright (c) 2005 Voltaire, Inc. All rights reserved. 6 * 7 * This software is available to you under a choice of one of two 8 * licenses. You may choose to be licensed under the terms of the GNU --- 533 unchanged lines hidden (view full) --- 542 543int ib_cache_gid_add(struct ib_device *ib_dev, u8 port, 544 union ib_gid *gid, struct ib_gid_attr *attr) 545{ 546 struct net_device *idev; 547 unsigned long mask; 548 int ret; 549 |
550 if (ib_dev->ops.get_netdev) { 551 idev = ib_dev->ops.get_netdev(ib_dev, port); 552 if (idev && attr->ndev != idev) { 553 union ib_gid default_gid; | 550 idev = ib_device_get_netdev(ib_dev, port); 551 if (idev && attr->ndev != idev) { 552 union ib_gid default_gid; |
554 | 553 |
555 /* Adding default GIDs in not permitted */ 556 make_default_gid(idev, &default_gid); 557 if (!memcmp(gid, &default_gid, sizeof(*gid))) { 558 dev_put(idev); 559 return -EPERM; 560 } 561 } 562 if (idev) | 554 /* Adding default GIDs is not permitted */ 555 make_default_gid(idev, &default_gid); 556 if (!memcmp(gid, &default_gid, sizeof(*gid))) { |
563 dev_put(idev); | 557 dev_put(idev); |
558 return -EPERM; 559 } |
|
564 } | 560 } |
561 if (idev) 562 dev_put(idev); |
|
565 566 mask = GID_ATTR_FIND_MASK_GID | 567 GID_ATTR_FIND_MASK_GID_TYPE | 568 GID_ATTR_FIND_MASK_NETDEV; 569 570 ret = __ib_cache_gid_add(ib_dev, port, gid, attr, mask, false); 571 return ret; 572} --- 897 unchanged lines hidden --- | 563 564 mask = GID_ATTR_FIND_MASK_GID | 565 GID_ATTR_FIND_MASK_GID_TYPE | 566 GID_ATTR_FIND_MASK_NETDEV; 567 568 ret = __ib_cache_gid_add(ib_dev, port, gid, attr, mask, false); 569 return ret; 570} --- 897 unchanged lines hidden --- |