]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
authorDavid S. Miller <davem@davemloft.net>
Wed, 7 Oct 2009 05:43:16 +0000 (22:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Oct 2009 05:43:16 +0000 (22:43 -0700)
1  2 
drivers/net/benet/be_ethtool.c
net/core/net-sysfs.c
net/core/pktgen.c

index 851543a040cb81b7482d29f32070f556eb4ba27c,cda5bf2fc50acf5b07406eff6ff488c532f67dbf..77c66da8738ca56e0b571aa88a8cb2a7ab600f16
@@@ -281,14 -281,9 +281,14 @@@ be_get_stat_strings(struct net_device *
        }
  }
  
 -static int be_get_stats_count(struct net_device *netdev)
 +static int be_get_sset_count(struct net_device *netdev, int stringset)
  {
 -      return ETHTOOL_STATS_NUM;
 +      switch (stringset) {
 +      case ETH_SS_STATS:
 +              return ETHTOOL_STATS_NUM;
 +      default:
 +              return -EINVAL;
 +      }
  }
  
  static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
@@@ -363,13 -358,13 +363,13 @@@ const struct ethtool_ops be_ethtool_op
        .get_rx_csum = be_get_rx_csum,
        .set_rx_csum = be_set_rx_csum,
        .get_tx_csum = ethtool_op_get_tx_csum,
-       .set_tx_csum = ethtool_op_set_tx_csum,
+       .set_tx_csum = ethtool_op_set_tx_hw_csum,
        .get_sg = ethtool_op_get_sg,
        .set_sg = ethtool_op_set_sg,
        .get_tso = ethtool_op_get_tso,
        .set_tso = ethtool_op_set_tso,
        .get_strings = be_get_stat_strings,
 -      .get_stats_count = be_get_stats_count,
 +      .get_sset_count = be_get_sset_count,
        .get_ethtool_stats = be_get_ethtool_stats,
        .flash_device = be_do_flash,
  };
diff --combined net/core/net-sysfs.c
index effb78410eb2c9f357e08b4974075359e8e3a4e6,427ded841224e6b7ce79cc91158efec24ab54b4a..4242e94ff1a5267238ed9749148d63a82c36a550
@@@ -130,44 -130,6 +130,44 @@@ static ssize_t show_carrier(struct devi
        return -EINVAL;
  }
  
 +static ssize_t show_speed(struct device *dev,
 +                        struct device_attribute *attr, char *buf)
 +{
 +      struct net_device *netdev = to_net_dev(dev);
 +      int ret = -EINVAL;
 +
 +      if (!rtnl_trylock())
 +              return restart_syscall();
 +
 +      if (netif_running(netdev) && netdev->ethtool_ops->get_settings) {
 +              struct ethtool_cmd cmd = { ETHTOOL_GSET };
 +
 +              if (!netdev->ethtool_ops->get_settings(netdev, &cmd))
 +                      ret = sprintf(buf, fmt_dec, ethtool_cmd_speed(&cmd));
 +      }
 +      rtnl_unlock();
 +      return ret;
 +}
 +
 +static ssize_t show_duplex(struct device *dev,
 +                         struct device_attribute *attr, char *buf)
 +{
 +      struct net_device *netdev = to_net_dev(dev);
 +      int ret = -EINVAL;
 +
 +      if (!rtnl_trylock())
 +              return restart_syscall();
 +
 +      if (netif_running(netdev) && netdev->ethtool_ops->get_settings) {
 +              struct ethtool_cmd cmd = { ETHTOOL_GSET };
 +
 +              if (!netdev->ethtool_ops->get_settings(netdev, &cmd))
 +                      ret = sprintf(buf, "%s\n", cmd.duplex ? "full" : "half");
 +      }
 +      rtnl_unlock();
 +      return ret;
 +}
 +
  static ssize_t show_dormant(struct device *dev,
                            struct device_attribute *attr, char *buf)
  {
@@@ -297,8 -259,6 +297,8 @@@ static struct device_attribute net_clas
        __ATTR(address, S_IRUGO, show_address, NULL),
        __ATTR(broadcast, S_IRUGO, show_broadcast, NULL),
        __ATTR(carrier, S_IRUGO, show_carrier, NULL),
 +      __ATTR(speed, S_IRUGO, show_speed, NULL),
 +      __ATTR(duplex, S_IRUGO, show_duplex, NULL),
        __ATTR(dormant, S_IRUGO, show_dormant, NULL),
        __ATTR(operstate, S_IRUGO, show_operstate, NULL),
        __ATTR(mtu, S_IRUGO | S_IWUSR, show_mtu, store_mtu),
@@@ -406,13 -366,13 +406,13 @@@ static ssize_t wireless_show(struct dev
        const struct iw_statistics *iw;
        ssize_t ret = -EINVAL;
  
-       read_lock(&dev_base_lock);
+       rtnl_lock();
        if (dev_isalive(dev)) {
                iw = get_wireless_stats(dev);
                if (iw)
                        ret = (*format)(iw, buf);
        }
-       read_unlock(&dev_base_lock);
+       rtnl_unlock();
  
        return ret;
  }
diff --combined net/core/pktgen.c
index e856ab0d074582ee6ed282158989b90773307981,86acdba0a97d657201349491a53b04ba198e4c98..1da0e038df788263346a9e1660daaeb14de8027f
@@@ -964,7 -964,7 +964,7 @@@ static ssize_t pktgen_if_write(struct f
                if (value == 0x7FFFFFFF)
                        pkt_dev->delay = ULLONG_MAX;
                else
-                       pkt_dev->delay = (u64)value * NSEC_PER_USEC;
+                       pkt_dev->delay = (u64)value;
  
                sprintf(pg_result, "OK: delay=%llu",
                        (unsigned long long) pkt_dev->delay);
@@@ -2212,7 -2212,7 +2212,7 @@@ static void set_cur_queue_map(struct pk
        if (pkt_dev->flags & F_QUEUE_MAP_CPU)
                pkt_dev->cur_queue_map = smp_processor_id();
  
-       else if (pkt_dev->queue_map_min < pkt_dev->queue_map_max) {
+       else if (pkt_dev->queue_map_min <= pkt_dev->queue_map_max) {
                __u16 t;
                if (pkt_dev->flags & F_QUEUE_MAP_RND) {
                        t = random32() %
@@@ -3441,14 -3441,12 +3441,14 @@@ static void pktgen_xmit(struct pktgen_d
        txq = netdev_get_tx_queue(odev, queue_map);
  
        __netif_tx_lock_bh(txq);
 -      atomic_inc(&(pkt_dev->skb->users));
  
 -      if (unlikely(netif_tx_queue_stopped(txq) || netif_tx_queue_frozen(txq)))
 +      if (unlikely(netif_tx_queue_stopped(txq) || netif_tx_queue_frozen(txq))) {
                ret = NETDEV_TX_BUSY;
 -      else
 -              ret = (*xmit)(pkt_dev->skb, odev);
 +              pkt_dev->last_ok = 0;
 +              goto unlock;
 +      }
 +      atomic_inc(&(pkt_dev->skb->users));
 +      ret = (*xmit)(pkt_dev->skb, odev);
  
        switch (ret) {
        case NETDEV_TX_OK:
                atomic_dec(&(pkt_dev->skb->users));
                pkt_dev->last_ok = 0;
        }
 +unlock:
        __netif_tx_unlock_bh(txq);
  
        /* If pkt_dev->count is zero, then run forever */