Author: yongari
Date: Thu Nov 13 04:11:01 2008
New Revision: 184908
URL: http://svn.freebsd.org/changeset/base/184908

Log:
  Fix Rx/Tx checksum offload ioctl handling. Now checksum offload
  can be controlled by ifconfig(8). Note, VLAN hardware tagging
  controls still lacks required handler but it requires more driver
  cleanups so I didn't touch that part.
  
  PR:   kern/128766

Modified:
  head/sys/dev/vge/if_vge.c

Modified: head/sys/dev/vge/if_vge.c
==============================================================================
--- head/sys/dev/vge/if_vge.c   Thu Nov 13 02:35:29 2008        (r184907)
+++ head/sys/dev/vge/if_vge.c   Thu Nov 13 04:11:01 2008        (r184908)
@@ -2226,15 +2226,17 @@ vge_ioctl(ifp, command, data)
                        }
                }
 #endif /* DEVICE_POLLING */
-               if (mask & IFCAP_HWCSUM) {
-                       ifp->if_capenable |= ifr->ifr_reqcap & (IFCAP_HWCSUM);
-                       if (ifp->if_capenable & IFCAP_TXCSUM)
-                               ifp->if_hwassist = VGE_CSUM_FEATURES;
+               if ((mask & IFCAP_TXCSUM) != 0 &&
+                   (ifp->if_capabilities & IFCAP_TXCSUM) != 0) {
+                       ifp->if_capenable ^= IFCAP_TXCSUM;
+                       if ((ifp->if_capenable & IFCAP_TXCSUM) != 0)
+                               ifp->if_hwassist |= VGE_CSUM_FEATURES;
                        else
-                               ifp->if_hwassist = 0;
-                       if (ifp->if_drv_flags & IFF_DRV_RUNNING)
-                               vge_init(sc);
+                               ifp->if_hwassist &= ~VGE_CSUM_FEATURES;
                }
+               if ((mask & IFCAP_RXCSUM) != 0 &&
+                   (ifp->if_capabilities & IFCAP_RXCSUM) != 0)
+                       ifp->if_capenable ^= IFCAP_RXCSUM;
            }
                break;
        default:
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to