aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sk98lin/skge.c
diff options
context:
space:
mode:
authorshemminger@osdl.org <shemminger@osdl.org>2005-11-24 01:00:52 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-12-01 02:22:52 -0500
commit09f5a214389fe467c2ff15aa2b85349bbde15bce (patch)
tree3d7929315ebcc558d11fd312796a5c2e99731af3 /drivers/net/sk98lin/skge.c
parente9022ee6c348d41cb62c55e15a9711f7a96f2399 (diff)
[PATCH] sk98lin: allow ethtool checksum on/off per port
Allow control of checksumming parameters via ethtool. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/sk98lin/skge.c')
-rw-r--r--drivers/net/sk98lin/skge.c66
1 files changed, 30 insertions, 36 deletions
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
index 107c5d97546c..02143fa3ee5b 100644
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@ -2189,13 +2189,10 @@ rx_start:
2189 skb_put(pMsg, FrameLength); 2189 skb_put(pMsg, FrameLength);
2190 } /* frame > SK_COPY_TRESHOLD */ 2190 } /* frame > SK_COPY_TRESHOLD */
2191 2191
2192#ifdef USE_SK_RX_CHECKSUM 2192 if (pRxPort->RxCsum) {
2193 pMsg->csum = pRxd->TcpSums; 2193 pMsg->csum = pRxd->TcpSums;
2194 pMsg->ip_summed = CHECKSUM_HW; 2194 pMsg->ip_summed = CHECKSUM_HW;
2195#else 2195 }
2196 pMsg->ip_summed = CHECKSUM_NONE;
2197#endif
2198
2199 2196
2200 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 1,("V")); 2197 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 1,("V"));
2201 ForRlmt = SK_RLMT_RX_PROTOCOL; 2198 ForRlmt = SK_RLMT_RX_PROTOCOL;
@@ -4149,6 +4146,7 @@ SK_BOOL DualNet;
4149 Flags); 4146 Flags);
4150 break; 4147 break;
4151 case SK_DRV_NET_UP: /* SK_U32 PortIdx */ 4148 case SK_DRV_NET_UP: /* SK_U32 PortIdx */
4149 { struct net_device *dev = pAC->dev[Param.Para32[0]];
4152 /* action list 5 */ 4150 /* action list 5 */
4153 FromPort = Param.Para32[0]; 4151 FromPort = Param.Para32[0];
4154 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT, 4152 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT,
@@ -4232,22 +4230,12 @@ SK_BOOL DualNet;
4232 printk(" irq moderation: disabled\n"); 4230 printk(" irq moderation: disabled\n");
4233 4231
4234 4232
4235#ifdef SK_ZEROCOPY 4233 printk(" scatter-gather: %s\n",
4236 if (pAC->ChipsetType) 4234 (dev->features & NETIF_F_SG) ? "enabled" : "disabled");
4237#ifdef USE_SK_TX_CHECKSUM 4235 printk(" tx-checksum: %s\n",
4238 printk(" scatter-gather: enabled\n"); 4236 (dev->features & NETIF_F_IP_CSUM) ? "enabled" : "disabled");
4239#else 4237 printk(" rx-checksum: %s\n",
4240 printk(" tx-checksum: disabled\n"); 4238 pAC->RxPort[Param.Para32[0]].RxCsum ? "enabled" : "disabled");
4241#endif
4242 else
4243 printk(" scatter-gather: disabled\n");
4244#else
4245 printk(" scatter-gather: disabled\n");
4246#endif
4247
4248#ifndef USE_SK_RX_CHECKSUM
4249 printk(" rx-checksum: disabled\n");
4250#endif
4251 4239
4252 } else { 4240 } else {
4253 DoPrintInterfaceChange = SK_TRUE; 4241 DoPrintInterfaceChange = SK_TRUE;
@@ -4262,9 +4250,9 @@ SK_BOOL DualNet;
4262 } 4250 }
4263 4251
4264 /* Inform the world that link protocol is up. */ 4252 /* Inform the world that link protocol is up. */
4265 netif_carrier_on(pAC->dev[Param.Para32[0]]); 4253 netif_carrier_on(dev);
4266
4267 break; 4254 break;
4255 }
4268 case SK_DRV_NET_DOWN: /* SK_U32 Reason */ 4256 case SK_DRV_NET_DOWN: /* SK_U32 Reason */
4269 /* action list 7 */ 4257 /* action list 7 */
4270 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT, 4258 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT,
@@ -4871,15 +4859,18 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
4871 SET_NETDEV_DEV(dev, &pdev->dev); 4859 SET_NETDEV_DEV(dev, &pdev->dev);
4872 SET_ETHTOOL_OPS(dev, &SkGeEthtoolOps); 4860 SET_ETHTOOL_OPS(dev, &SkGeEthtoolOps);
4873 4861
4874#ifdef SK_ZEROCOPY 4862 /* Use only if yukon hardware */
4875#ifdef USE_SK_TX_CHECKSUM
4876 if (pAC->ChipsetType) { 4863 if (pAC->ChipsetType) {
4877 /* Use only if yukon hardware */ 4864#ifdef USE_SK_TX_CHECKSUM
4878 /* SK and ZEROCOPY - fly baby... */ 4865 dev->features |= NETIF_F_IP_CSUM;
4879 dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
4880 }
4881#endif 4866#endif
4867#ifdef SK_ZEROCOPY
4868 dev->features |= NETIF_F_SG;
4869#endif
4870#ifdef USE_SK_RX_CHECKSUM
4871 pAC->RxPort[0].RxCsum = 1;
4882#endif 4872#endif
4873 }
4883 4874
4884 pAC->Index = boards_found++; 4875 pAC->Index = boards_found++;
4885 4876
@@ -4944,14 +4935,17 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
4944 SET_NETDEV_DEV(dev, &pdev->dev); 4935 SET_NETDEV_DEV(dev, &pdev->dev);
4945 SET_ETHTOOL_OPS(dev, &SkGeEthtoolOps); 4936 SET_ETHTOOL_OPS(dev, &SkGeEthtoolOps);
4946 4937
4947#ifdef SK_ZEROCOPY
4948#ifdef USE_SK_TX_CHECKSUM
4949 if (pAC->ChipsetType) { 4938 if (pAC->ChipsetType) {
4950 /* SG and ZEROCOPY - fly baby... */ 4939#ifdef USE_SK_TX_CHECKSUM
4951 dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; 4940 dev->features |= NETIF_F_IP_CSUM;
4952 }
4953#endif 4941#endif
4942#ifdef SK_ZEROCOPY
4943 dev->features |= NETIF_F_SG;
4944#endif
4945#ifdef USE_SK_RX_CHECKSUM
4946 pAC->RxPort[1].RxCsum = 1;
4954#endif 4947#endif
4948 }
4955 4949
4956 if (register_netdev(dev)) { 4950 if (register_netdev(dev)) {
4957 printk(KERN_ERR "sk98lin: Could not register device for seconf port.\n"); 4951 printk(KERN_ERR "sk98lin: Could not register device for seconf port.\n");