aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb3/cxgb3_offload.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/cxgb3/cxgb3_offload.c')
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
index e620ed4c3ff0..bdff7baeb59d 100644
--- a/drivers/net/cxgb3/cxgb3_offload.c
+++ b/drivers/net/cxgb3/cxgb3_offload.c
@@ -593,6 +593,16 @@ int cxgb3_alloc_stid(struct t3cdev *tdev, struct cxgb3_client *client,
593 593
594EXPORT_SYMBOL(cxgb3_alloc_stid); 594EXPORT_SYMBOL(cxgb3_alloc_stid);
595 595
596/* Get the t3cdev associated with a net_device */
597struct t3cdev *dev2t3cdev(struct net_device *dev)
598{
599 const struct port_info *pi = netdev_priv(dev);
600
601 return (struct t3cdev *)pi->adapter;
602}
603
604EXPORT_SYMBOL(dev2t3cdev);
605
596static int do_smt_write_rpl(struct t3cdev *dev, struct sk_buff *skb) 606static int do_smt_write_rpl(struct t3cdev *dev, struct sk_buff *skb)
597{ 607{
598 struct cpl_smt_write_rpl *rpl = cplhdr(skb); 608 struct cpl_smt_write_rpl *rpl = cplhdr(skb);
@@ -925,7 +935,7 @@ void cxgb_neigh_update(struct neighbour *neigh)
925 struct net_device *dev = neigh->dev; 935 struct net_device *dev = neigh->dev;
926 936
927 if (dev && (is_offloading(dev))) { 937 if (dev && (is_offloading(dev))) {
928 struct t3cdev *tdev = T3CDEV(dev); 938 struct t3cdev *tdev = dev2t3cdev(dev);
929 939
930 BUG_ON(!tdev); 940 BUG_ON(!tdev);
931 t3_l2t_update(tdev, neigh); 941 t3_l2t_update(tdev, neigh);
@@ -973,9 +983,9 @@ void cxgb_redirect(struct dst_entry *old, struct dst_entry *new)
973 "device ignored.\n", __FUNCTION__); 983 "device ignored.\n", __FUNCTION__);
974 return; 984 return;
975 } 985 }
976 tdev = T3CDEV(olddev); 986 tdev = dev2t3cdev(olddev);
977 BUG_ON(!tdev); 987 BUG_ON(!tdev);
978 if (tdev != T3CDEV(newdev)) { 988 if (tdev != dev2t3cdev(newdev)) {
979 printk(KERN_WARNING "%s: Redirect to different " 989 printk(KERN_WARNING "%s: Redirect to different "
980 "offload device ignored.\n", __FUNCTION__); 990 "offload device ignored.\n", __FUNCTION__);
981 return; 991 return;