aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb3/cxgb3_offload.c
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2007-08-29 22:15:47 -0400
committerJeff Garzik <jeff@garzik.org>2007-08-31 07:29:08 -0400
commit5fbf816fe7d72bfdbf22bfec05b4ec3aa6849f72 (patch)
tree62f35df3e9078e3f981b9c04176d9a9cb557a53a /drivers/net/cxgb3/cxgb3_offload.c
parent54d0f56e63edb1aa3901ea6389bf7ea5d43d0c22 (diff)
cxgb3 - Fix dev->priv usage
cxgb3 used netdev_priv() and dev->priv for different purposes. In 2.6.23, netdev_priv() == dev->priv, cxgb3 needs a fix. This patch is a partial backport of Dave Miller's changes in the net-2.6.24 git branch. Without this fix, cxgb3 crashes on 2.6.23. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
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;