rpms/kernel/F-8 linux-2.6-print-mac.patch, NONE, 1.1 linux-2.6-libertas-backport.patch, NONE, 1.1
David Woodhouse (dwmw2)
fedora-extras-commits at redhat.com
Wed Dec 19 15:48:14 UTC 2007
Author: dwmw2
Update of /cvs/pkgs/rpms/kernel/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22277
Added Files:
linux-2.6-print-mac.patch linux-2.6-libertas-backport.patch
Log Message:
make libertas work in 2.6.23
linux-2.6-print-mac.patch:
--- NEW FILE linux-2.6-print-mac.patch ---
commit 0795af5729b18218767fab27c44b1384f72dc9ad
Author: Joe Perches <joe at perches.com>
Date: Wed Oct 3 17:59:30 2007 -0700
[NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()
This is nicer than the MAC_FMT stuff.
Signed-off-by: Joe Perches <joe at perches.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index 3213f6f..0e791e2 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -120,6 +120,14 @@ static inline struct ethhdr *eth_hdr(const struct sk_buff *skb)
#ifdef CONFIG_SYSCTL
extern struct ctl_table ether_table[];
#endif
+
+/*
+ * Display a 6 byte device address (MAC) in a readable format.
+ */
+#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
+extern char *print_mac(char *buf, const u8 *addr);
+#define DECLARE_MAC_BUF(var) char var[18] __maybe_unused
+
#endif
#endif /* _LINUX_IF_ETHER_H */
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 57c592e..2aaf6fa 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -337,3 +337,11 @@ struct net_device *alloc_etherdev_mq(int sizeof_priv, unsigned int queue_count)
return alloc_netdev_mq(sizeof_priv, "eth%d", ether_setup, queue_count);
}
EXPORT_SYMBOL(alloc_etherdev_mq);
+
+char *print_mac(char *buf, const u8 *addr)
+{
+ sprintf(buf, MAC_FMT,
+ addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
+ return buf;
+}
+EXPORT_SYMBOL(print_mac);
linux-2.6-libertas-backport.patch:
--- NEW FILE linux-2.6-libertas-backport.patch ---
Libertas backport. Provide usb_endpoint_num() and revert this:
commit b9f2c0440d806e01968c3ed4def930a43be248ad
Author: Jeff Garzik <jeff at garzik.org>
Date: Wed Oct 3 18:07:32 2007 -0700
[netdrvr] Stop using legacy hooks ->self_test_count, ->get_stats_count
These have been superceded by the new ->get_sset_count() hook.
Signed-off-by: Jeff Garzik <jeff at garzik.org>
Signed-off-by: David S. Miller <davem at davemloft.net>
reverted:
--- b/drivers/net/wireless/libertas/ethtool.c
+++ a/drivers/net/wireless/libertas/ethtool.c
@@ -109,8 +109,29 @@
struct ethtool_stats * stats, u64 * data)
{
struct lbs_private *priv = dev->priv;
+
+ lbs_deb_enter(LBS_DEB_ETHTOOL);
+
+ stats->cmd = ETHTOOL_GSTATS;
+ BUG_ON(stats->n_stats != MESH_STATS_NUM);
+
+ data[0] = priv->mstats.fwd_drop_rbt;
+ data[1] = priv->mstats.fwd_drop_ttl;
+ data[2] = priv->mstats.fwd_drop_noroute;
+ data[3] = priv->mstats.fwd_drop_nobuf;
+ data[4] = priv->mstats.fwd_unicast_cnt;
+ data[5] = priv->mstats.fwd_bcast_cnt;
+ data[6] = priv->mstats.drop_blind;
+ data[7] = priv->mstats.tx_failed_cnt;
+
+ lbs_deb_enter(LBS_DEB_ETHTOOL);
+}
+
+static int lbs_ethtool_get_stats_count(struct net_device * dev)
+{
+ int ret;
+ struct lbs_private *priv = dev->priv;
struct cmd_ds_mesh_access mesh_access;
- int ret;
lbs_deb_enter(LBS_DEB_ETHTOOL);
@@ -119,38 +140,25 @@
CMD_MESH_ACCESS, CMD_ACT_MESH_GET_STATS,
CMD_OPTION_WAITFORRSP, 0, &mesh_access);
+ if (ret) {
+ ret = 0;
+ goto done;
+ }
+
+ priv->mstats.fwd_drop_rbt = le32_to_cpu(mesh_access.data[0]);
+ priv->mstats.fwd_drop_ttl = le32_to_cpu(mesh_access.data[1]);
+ priv->mstats.fwd_drop_noroute = le32_to_cpu(mesh_access.data[2]);
+ priv->mstats.fwd_drop_nobuf = le32_to_cpu(mesh_access.data[3]);
+ priv->mstats.fwd_unicast_cnt = le32_to_cpu(mesh_access.data[4]);
+ priv->mstats.fwd_bcast_cnt = le32_to_cpu(mesh_access.data[5]);
+ priv->mstats.drop_blind = le32_to_cpu(mesh_access.data[6]);
+ priv->mstats.tx_failed_cnt = le32_to_cpu(mesh_access.data[7]);
- if (ret)
- return;
-
- priv->mstats.fwd_drop_rbt = le32_to_cpu(mesh_access.data[0]);
- priv->mstats.fwd_drop_ttl = le32_to_cpu(mesh_access.data[1]);
- priv->mstats.fwd_drop_noroute = le32_to_cpu(mesh_access.data[2]);
- priv->mstats.fwd_drop_nobuf = le32_to_cpu(mesh_access.data[3]);
- priv->mstats.fwd_unicast_cnt = le32_to_cpu(mesh_access.data[4]);
- priv->mstats.fwd_bcast_cnt = le32_to_cpu(mesh_access.data[5]);
- priv->mstats.drop_blind = le32_to_cpu(mesh_access.data[6]);
- priv->mstats.tx_failed_cnt = le32_to_cpu(mesh_access.data[7]);
-
- data[0] = priv->mstats.fwd_drop_rbt;
- data[1] = priv->mstats.fwd_drop_ttl;
- data[2] = priv->mstats.fwd_drop_noroute;
- data[3] = priv->mstats.fwd_drop_nobuf;
- data[4] = priv->mstats.fwd_unicast_cnt;
- data[5] = priv->mstats.fwd_bcast_cnt;
- data[6] = priv->mstats.drop_blind;
- data[7] = priv->mstats.tx_failed_cnt;
+ ret = MESH_STATS_NUM;
- lbs_deb_enter(LBS_DEB_ETHTOOL);
-}
+done:
+ lbs_deb_enter_args(LBS_DEB_ETHTOOL, "ret %d", ret);
+ return ret;
-static int lbs_ethtool_get_sset_count(struct net_device * dev, int sset)
-{
- switch (sset) {
- case ETH_SS_STATS:
- return MESH_STATS_NUM;
- default:
- return -EOPNOTSUPP;
- }
}
static void lbs_ethtool_get_strings (struct net_device * dev,
@@ -177,6 +185,6 @@
.get_drvinfo = lbs_ethtool_get_drvinfo,
.get_eeprom = lbs_ethtool_get_eeprom,
.get_eeprom_len = lbs_ethtool_get_eeprom_len,
+ .get_stats_count = lbs_ethtool_get_stats_count,
- .get_sset_count = lbs_ethtool_get_sset_count,
.get_ethtool_stats = lbs_ethtool_get_stats,
.get_strings = lbs_ethtool_get_strings,
More information about the fedora-extras-commits
mailing list