Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / net / sk98lin / skethtool.c
index 0aed3b9..4265ed9 100644 (file)
@@ -257,7 +257,7 @@ static void getDriverInfo(struct net_device *dev, struct ethtool_drvinfo *info)
        strlcpy(info->driver, DRIVER_FILE_NAME, sizeof(info->driver));
        strcpy(info->version, vers);
        strcpy(info->fw_version, "N/A");
-       strlcpy(info->bus_info, pAC->PciDev->slot_name, ETHTOOL_BUSINFO_LEN);
+       strlcpy(info->bus_info, pci_name(pAC->PciDev), ETHTOOL_BUSINFO_LEN);
 }
 
 /*
@@ -437,9 +437,6 @@ static int locateDevice(struct net_device *dev, u32 data)
        pAC->LedsOn = 0;
        mod_timer(&pAC->BlinkTimer, jiffies);
        msleep_interruptible(data * 1000);
-
-       set_current_state(TASK_INTERRUPTIBLE);
-       schedule_timeout(data * HZ);
        del_timer_sync(&pAC->BlinkTimer);
        toggleLeds(pNet, 0);
 
@@ -542,6 +539,48 @@ static int setPauseParams(struct net_device *dev , struct ethtool_pauseparam *ep
         return ret ? -EIO : 0;
 }
 
+/* Only Yukon supports checksum offload. */
+static int setScatterGather(struct net_device *dev, u32 data)
+{
+       DEV_NET *pNet = netdev_priv(dev);
+       SK_AC *pAC = pNet->pAC;
+
+       if (pAC->GIni.GIChipId == CHIP_ID_GENESIS)
+               return -EOPNOTSUPP;
+       return ethtool_op_set_sg(dev, data);
+}
+
+static int setTxCsum(struct net_device *dev, u32 data)
+{
+       DEV_NET *pNet = netdev_priv(dev);
+       SK_AC *pAC = pNet->pAC;
+
+       if (pAC->GIni.GIChipId == CHIP_ID_GENESIS)
+               return -EOPNOTSUPP;
+
+       return ethtool_op_set_tx_csum(dev, data);
+}
+
+static u32 getRxCsum(struct net_device *dev)
+{
+       DEV_NET *pNet = netdev_priv(dev);
+       SK_AC *pAC = pNet->pAC;
+
+       return pAC->RxPort[pNet->PortNr].RxCsum;
+}
+
+static int setRxCsum(struct net_device *dev, u32 data)
+{
+       DEV_NET *pNet = netdev_priv(dev);
+       SK_AC *pAC = pNet->pAC;
+
+       if (pAC->GIni.GIChipId == CHIP_ID_GENESIS)
+               return -EOPNOTSUPP;
+
+       pAC->RxPort[pNet->PortNr].RxCsum = data != 0;
+       return 0;
+}
+
 struct ethtool_ops SkGeEthtoolOps = {
        .get_settings           = getSettings,
        .set_settings           = setSettings,
@@ -552,4 +591,12 @@ struct ethtool_ops SkGeEthtoolOps = {
        .phys_id                = locateDevice,
        .get_pauseparam         = getPauseParams,
        .set_pauseparam         = setPauseParams,
+       .get_link               = ethtool_op_get_link,
+       .get_perm_addr          = ethtool_op_get_perm_addr,
+       .get_sg                 = ethtool_op_get_sg,
+       .set_sg                 = setScatterGather,
+       .get_tx_csum            = ethtool_op_get_tx_csum,
+       .set_tx_csum            = setTxCsum,
+       .get_rx_csum            = getRxCsum,
+       .set_rx_csum            = setRxCsum,
 };