diff options
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib.h')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index 2f85a9a831b1..1251f86ec856 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h | |||
@@ -217,10 +217,16 @@ struct ipoib_neigh { | |||
217 | struct list_head list; | 217 | struct list_head list; |
218 | }; | 218 | }; |
219 | 219 | ||
220 | /* | ||
221 | * We stash a pointer to our private neighbour information after our | ||
222 | * hardware address in neigh->ha. The ALIGN() expression here makes | ||
223 | * sure that this pointer is stored aligned so that an unaligned | ||
224 | * load is not needed to dereference it. | ||
225 | */ | ||
220 | static inline struct ipoib_neigh **to_ipoib_neigh(struct neighbour *neigh) | 226 | static inline struct ipoib_neigh **to_ipoib_neigh(struct neighbour *neigh) |
221 | { | 227 | { |
222 | return (struct ipoib_neigh **) (neigh->ha + 24 - | 228 | return (void*) neigh + ALIGN(offsetof(struct neighbour, ha) + |
223 | (offsetof(struct neighbour, ha) & 4)); | 229 | INFINIBAND_ALEN, sizeof(void *)); |
224 | } | 230 | } |
225 | 231 | ||
226 | extern struct workqueue_struct *ipoib_workqueue; | 232 | extern struct workqueue_struct *ipoib_workqueue; |
@@ -253,7 +259,7 @@ void ipoib_ib_dev_cleanup(struct net_device *dev); | |||
253 | 259 | ||
254 | int ipoib_ib_dev_open(struct net_device *dev); | 260 | int ipoib_ib_dev_open(struct net_device *dev); |
255 | int ipoib_ib_dev_up(struct net_device *dev); | 261 | int ipoib_ib_dev_up(struct net_device *dev); |
256 | int ipoib_ib_dev_down(struct net_device *dev); | 262 | int ipoib_ib_dev_down(struct net_device *dev, int flush); |
257 | int ipoib_ib_dev_stop(struct net_device *dev); | 263 | int ipoib_ib_dev_stop(struct net_device *dev); |
258 | 264 | ||
259 | int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port); | 265 | int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port); |