* Re: [PATCH] ssb: use pci_dev->revision
From: Sergei Shtylyov @ 2011-06-23 15:11 UTC (permalink / raw)
To: Michael Büsch; +Cc: Sergei Shtylyov, netdev
In-Reply-To: <20110623170908.1417f933@maggie>
Hello.
Michael Büsch wrote:
>> The bus scan code reads PCI revision ID from the PCI configuration register
>> while it's already stored by PCI subsystem in the 'revision' field of 'struct
>> pci_dev'...
>> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
>> ---
>> The patch is against the recent Linus' tree.
>> There's another place where the revision ID register is read but as 16-bit
>> entity (probably by mistake though), so I didn't convert it...
> Where is that?
drivers/ssb/pci.c, line 741.
WBR, Sergei
^ permalink raw reply
* Re: unintended ipv4 broadcast policy change
From: Stephen Hemminger @ 2011-06-23 15:16 UTC (permalink / raw)
To: David Miller; +Cc: herbert, netdev
In-Reply-To: <20110622.163935.2248705300315908767.davem@davemloft.net>
On Wed, 22 Jun 2011 16:39:35 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
> But debian definitely still has this bug. On debian, as a result,
> every packet received gets parsed.
Are you saying the DHCP client ends up parsing every packet?
This doesn't appear to be true.
I checked and the dhclient spends its life waiting on select for DHCP port.
^ permalink raw reply
* Re: [PATCH] ssb: use pci_dev->revision
From: Michael Büsch @ 2011-06-23 15:32 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: Sergei Shtylyov, netdev
In-Reply-To: <4E0357BF.7000408@mvista.com>
On Thu, 23 Jun 2011 19:11:59 +0400
Sergei Shtylyov <sshtylyov@mvista.com> wrote:
> Hello.
>
> Michael Büsch wrote:
>
> >> The bus scan code reads PCI revision ID from the PCI configuration register
> >> while it's already stored by PCI subsystem in the 'revision' field of 'struct
> >> pci_dev'...
>
> >> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
>
> >> ---
> >> The patch is against the recent Linus' tree.
>
> >> There's another place where the revision ID register is read but as 16-bit
> >> entity (probably by mistake though), so I didn't convert it...
>
> > Where is that?
>
> drivers/ssb/pci.c, line 741.
Yes that probably is by mistake. Can you convert it as well, please?
^ permalink raw reply
* Re: [PATCH 1/2] iwlwifi: use pci_dev->revision, again
From: Guy, Wey-Yi @ 2011-06-23 15:02 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: netdev@vger.kernel.org, linville@tuxdriver.com,
linux-wireless@vger.kernel.org, ilw@linux.intel.com
In-Reply-To: <201106231841.40691.sshtylyov@ru.mvista.com>
On Thu, 2011-06-23 at 07:41 -0700, Sergei Shtylyov wrote:
> Commit ff938e43d39e926de74b32a3656c190f979ab642 (net: use pci_dev->revision,
> again) already converted this driver to using the 'revision' field of 'struct
> pci_dev' but commit c2974a1d18832a9fffb2eb389c3878f5c4ed92f1 (iwlagn: remove
> rev_id) later reverted that change for no reason. Now restore the change...
>
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
>
> ---
> The patch is against the recent Linus' tree.
>
> drivers/net/wireless/iwlwifi/iwl-agn.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> Index: linux-2.6/drivers/net/wireless/iwlwifi/iwl-agn.c
> ===================================================================
> --- linux-2.6.orig/drivers/net/wireless/iwlwifi/iwl-agn.c
> +++ linux-2.6/drivers/net/wireless/iwlwifi/iwl-agn.c
> @@ -3275,10 +3275,9 @@ struct ieee80211_ops iwlagn_hw_ops = {
>
> static u32 iwl_hw_detect(struct iwl_priv *priv)
> {
> - u8 rev_id;
> + IWL_DEBUG_INFO(priv, "HW Revision ID = 0x%X\n",
> + priv->pci_dev->revision);
>
> - pci_read_config_byte(priv->pci_dev, PCI_REVISION_ID, &rev_id);
> - IWL_DEBUG_INFO(priv, "HW Revision ID = 0x%X\n", rev_id);
> return iwl_read32(priv, CSR_HW_REV);
> }
>
hmm, I believe it is merge sequence issue, the IWL_DEBUG_INFO line has
benn remove all together in later patch. the information is being log in
the calling function, no need to log in "iwl_hw_detect"
Wey
^ permalink raw reply
* Re: linux-next: Tree for June 23 (net)
From: Randy Dunlap @ 2011-06-23 16:14 UTC (permalink / raw)
To: Stephen Rothwell, netdev; +Cc: linux-next, LKML
In-Reply-To: <20110623155431.6bfe3b40.sfr@canb.auug.org.au>
On Thu, 23 Jun 2011 15:54:31 +1000 Stephen Rothwell wrote:
> Hi all,
>
> Changes since 20110622:
>
> The powerpc allyesconfig (and probably others) is still broken because we
> now build the staging drivers and because of a commit in the net tree.
> The breakage in Linus' tree is fixed by one of Andrew's patches above.
>
> The net tree gained 2 build failures that I have left (see above).
When CONFIG_INET is not enabled:
net/core/dev.c:2535: error: implicit declaration of function 'ip_is_fragment'
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply
* Re: linux-next: Tree for June 23 (net)
From: Randy Dunlap @ 2011-06-23 17:17 UTC (permalink / raw)
To: netdev; +Cc: Stephen Rothwell, linux-next, LKML
In-Reply-To: <20110623091429.2d51b0f0.randy.dunlap@oracle.com>
On Thu, 23 Jun 2011 09:14:29 -0700 Randy Dunlap wrote:
> On Thu, 23 Jun 2011 15:54:31 +1000 Stephen Rothwell wrote:
>
> > Hi all,
> >
> > Changes since 20110622:
> >
> > The powerpc allyesconfig (and probably others) is still broken because we
> > now build the staging drivers and because of a commit in the net tree.
> > The breakage in Linus' tree is fixed by one of Andrew's patches above.
> >
> > The net tree gained 2 build failures that I have left (see above).
>
>
> When CONFIG_INET is not enabled:
>
> net/core/dev.c:2535: error: implicit declaration of function 'ip_is_fragment'
same problem in more places:
net/sched/sch_choke.c:184: error: implicit declaration of function 'ip_is_fragment'
net/sched/cls_rsvp.h:170: error: implicit declaration of function 'ip_is_fragment'
net/sched/cls_flow.c:124: error: implicit declaration of function 'ip_is_fragment'
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply
* [PATCH 20/35] drivers/net changes for SMBIOS and System Firmware
From: Prarit Bhargava @ 2011-06-23 17:24 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: Prarit Bhargava
drivers/net changes for SMBIOS and System Firmware
As part of the new SMBIOS and System Firmware code:
- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
drivers/net/skge.c | 11 ++++++-----
drivers/net/via-rhine.c | 18 ++++++++++--------
drivers/net/wireless/wl1251/sdio.c | 1 -
3 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index f4be5c7..1200c53 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -43,7 +43,7 @@
#include <linux/seq_file.h>
#include <linux/mii.h>
#include <linux/slab.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/prefetch.h>
#include <asm/irq.h>
@@ -4089,12 +4089,13 @@ static struct pci_driver skge_driver = {
.driver.pm = SKGE_PM_OPS,
};
-static struct dmi_system_id skge_32bit_dma_boards[] = {
+static struct sysfw_id skge_32bit_dma_boards[] = {
{
.ident = "Gigabyte nForce boards",
.matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co"),
- DMI_MATCH(DMI_BOARD_NAME, "nForce"),
+ SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+ "Gigabyte Technology Co"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "nForce"),
},
},
{}
@@ -4102,7 +4103,7 @@ static struct dmi_system_id skge_32bit_dma_boards[] = {
static int __init skge_init_module(void)
{
- if (dmi_check_system(skge_32bit_dma_boards))
+ if (sysfw_callback(skge_32bit_dma_boards))
only_32bit_dma = 1;
skge_debug_init();
return pci_register_driver(&skge_driver);
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index 7f23ab9..81725d5 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -110,7 +110,7 @@ static const int multicast_filter_limit = 32;
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
/* These identify the driver base version and may not be removed. */
static const char version[] __devinitconst =
@@ -2294,22 +2294,24 @@ static struct pci_driver rhine_driver = {
.shutdown = rhine_shutdown,
};
-static struct dmi_system_id __initdata rhine_dmi_table[] = {
+static struct sysfw_id __initdata rhine_id_table[] = {
{
.ident = "EPIA-M",
.matches = {
- DMI_MATCH(DMI_BIOS_VENDOR, "Award Software International, Inc."),
- DMI_MATCH(DMI_BIOS_VERSION, "6.00 PG"),
+ SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Award Software International, Inc."),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "6.00 PG"),
},
},
{
.ident = "KV7",
.matches = {
- DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "6.00 PG"),
+ SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies, LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "6.00 PG"),
},
},
- { NULL }
+ {}
};
static int __init rhine_init(void)
@@ -2318,7 +2320,7 @@ static int __init rhine_init(void)
#ifdef MODULE
pr_info("%s\n", version);
#endif
- if (dmi_check_system(rhine_dmi_table)) {
+ if (sysfw_callback(rhine_id_table)) {
/* these BIOSes fail at PXE boot if chip is in D3 */
avoid_D3 = 1;
pr_warn("Broken BIOS detected, avoid_D3 enabled\n");
diff --git a/drivers/net/wireless/wl1251/sdio.c b/drivers/net/wireless/wl1251/sdio.c
index f51a024..68e36d7 100644
--- a/drivers/net/wireless/wl1251/sdio.c
+++ b/drivers/net/wireless/wl1251/sdio.c
@@ -20,7 +20,6 @@
* Copyright (C) 2009 Bob Copeland (me@bobcopeland.com)
*/
#include <linux/module.h>
-#include <linux/mod_devicetable.h>
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/sdio_ids.h>
#include <linux/platform_device.h>
--
1.7.5.4
^ permalink raw reply related
* Re: [RFT PATCH 0/9] Cleanup and extension of netdev features
From: Mahesh Bandewar @ 2011-06-23 17:42 UTC (permalink / raw)
To: Michał Mirosław; +Cc: netdev, David S. Miller, Ben Hutchings
In-Reply-To: <cover.1308596962.git.mirq-linux@rere.qmqm.pl>
On Mon, Jun 20, 2011 at 12:14 PM, Michał Mirosław
<mirq-linux@rere.qmqm.pl> wrote:
>
> This is a preview of the cleanups pending after getting rid of old
> ethtool ops from remaining drivers.
>
> Patches inside:
> 1. (placeholder for Intel patches)
> 2. removal of old ethtool ops
> (most further patches depend on this one)
> 3. break association of ETH_FLAG_* with netdev features
> this will allow to change the representation and access pattern
> of the feature sets if later needed; as a bonus, the features
> can be (almost) freely rearranged
> 4. introducing netdev_features_t
> use new type wherever features are passed around (this needed
> new include - otherwise linux/skbuff.h would need linux/netdevice.h)
> 5. cleanup of feature bits
> 6. cleanup of feature name table
> (depends on #5)
> 7. prepare ethtool [GS]FEATURES for larger netdev_features_t
> 8. tadaaa: 64 bits for features
> 9. a lone cleanup patch for NOCACHE_COPY feature
>
> Bear in mind, that I only compile tested the whole series (x86 allyesconfig).
> I'll do per-patch builds after all needed patches are in net-next.
>
> Note about netdev_features_t: I don't like the idea of converting it to
> bitmap type and building wrappers around, so I won't even try to
> implement it. Nevertheless, this series will make the conversion easier
> if someone ever wants to go that way.
>
The idea is to make feature type (by defining netdev_feature_t)
opaque and should handle XX bit integer as well as bitmap types. So
netdev_feature_t typedef-ed to u64 is OK but changes that we make
should be able to handle bitmaps as well to minimize future changes.
--mahesh..
> Best Regards,
> Michał Mirosław
>
> ---
>
> Michał Mirosław (9):
> [NOT SENT] Intel net drivers: convert to ndo_fix_features
> net: remove legacy ethtool ops
> net: ethtool: break association of ETH_FLAG_* with NETIF_F_*
> net: introduce and use netdev_features_t for device features sets
> net: Define enum for net device features.
> net: ethtool: use C99 array initialization for feature-names table
> ethtool: prepare for larger netdev_features_t type
> net: extend netdev_features_t to 64 bits
> net: move NOCACHE_COPY checks to netdev_fix_features()
>
> drivers/net/8139cp.c | 2 +-
> drivers/net/bnx2.c | 6 +-
> drivers/net/bnx2x/bnx2x_cmn.c | 5 +-
> drivers/net/bnx2x/bnx2x_cmn.h | 5 +-
> drivers/net/bonding/bond_main.c | 9 +-
> drivers/net/cxgb4/cxgb4_main.c | 12 +-
> drivers/net/dm9000.c | 3 +-
> drivers/net/e1000/e1000_ethtool.c | 69 ----
> drivers/net/e1000/e1000_main.c | 31 ++-
> drivers/net/e1000e/ethtool.c | 88 -----
> drivers/net/e1000e/netdev.c | 35 ++-
> drivers/net/forcedeth.c | 7 +-
> drivers/net/gianfar.h | 2 +-
> drivers/net/gianfar_ethtool.c | 4 +-
> drivers/net/ibmveth.c | 6 +-
> drivers/net/igb/igb_ethtool.c | 67 ----
> drivers/net/igb/igb_main.c | 33 ++-
> drivers/net/igbvf/ethtool.c | 57 ----
> drivers/net/igbvf/netdev.c | 25 ++-
> drivers/net/ixgb/ixgb.h | 2 +
> drivers/net/ixgb/ixgb_ethtool.c | 98 +------
> drivers/net/ixgb/ixgb_main.c | 44 +++-
> drivers/net/ixgbe/ixgbe_ethtool.c | 183 ++++--------
> drivers/net/ixgbe/ixgbe_main.c | 42 ++-
> drivers/net/ixgbevf/ethtool.c | 46 ---
> drivers/net/ixgbevf/ixgbevf_main.c | 26 ++-
> drivers/net/jme.c | 8 +-
> drivers/net/ksz884x.c | 3 +-
> drivers/net/mv643xx_eth.c | 2 +-
> drivers/net/myri10ge/myri10ge.c | 2 +-
> drivers/net/netxen/netxen_nic_main.c | 6 +-
> drivers/net/pch_gbe/pch_gbe_main.c | 5 +-
> drivers/net/qlcnic/qlcnic.h | 5 +-
> drivers/net/qlcnic/qlcnic_hw.c | 9 +-
> drivers/net/qlcnic/qlcnic_main.c | 2 +-
> drivers/net/r8169.c | 6 +-
> drivers/net/s2io.c | 4 +-
> drivers/net/sfc/efx.c | 2 +-
> drivers/net/sky2.c | 5 +-
> drivers/net/tg3.c | 7 +-
> drivers/net/usb/smsc75xx.c | 3 +-
> drivers/net/usb/smsc95xx.c | 3 +-
> drivers/net/vmxnet3/vmxnet3_ethtool.c | 4 +-
> drivers/net/vmxnet3/vmxnet3_int.h | 2 +-
> drivers/net/vxge/vxge-main.c | 9 +-
> drivers/net/xen-netfront.c | 8 +-
> drivers/s390/net/qeth_l3_main.c | 6 +-
> include/linux/ethtool.h | 53 ---
> include/linux/netdev_features.h | 152 +++++++++
> include/linux/netdevice.h | 141 ++-------
> include/linux/skbuff.h | 4 +-
> include/net/protocol.h | 4 +-
> include/net/tcp.h | 3 +-
> include/net/udp.h | 3 +-
> net/8021q/vlan_dev.c | 5 +-
> net/bridge/br_if.c | 5 +-
> net/core/dev.c | 71 ++--
> net/core/ethtool.c | 563 ++++++--------------------------
> net/core/net-sysfs.c | 3 +-
> net/core/skbuff.c | 2 +-
> net/ipv4/af_inet.c | 3 +-
> net/ipv4/tcp.c | 2 +-
> net/ipv4/udp.c | 3 +-
> net/ipv6/af_inet6.c | 3 +-
> net/ipv6/udp.c | 2 +-
> 65 files changed, 683 insertions(+), 1347 deletions(-)
> create mode 100644 include/linux/netdev_features.h
>
> --
> 1.7.2.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [RFT PATCH 7/9] ethtool: prepare for larger netdev_features_t type
From: Mahesh Bandewar @ 2011-06-23 17:50 UTC (permalink / raw)
To: Ben Hutchings, Michał Mirosław; +Cc: netdev, David S. Miller
In-Reply-To: <1308604618.2701.189.camel@bwh-desktop>
On Mon, Jun 20, 2011 at 2:16 PM, Ben Hutchings
<bhutchings@solarflare.com> wrote:
>
> On Mon, 2011-06-20 at 21:14 +0200, Michał Mirosław wrote:
> [...]
> > @@ -125,19 +131,26 @@ static int ethtool_set_features(struct net_device *dev, void __user *useraddr)
> > if (copy_from_user(features, useraddr, sizeof(features)))
> > return -EFAULT;
> >
> > - if (features[0].valid & ~NETIF_F_ETHTOOL_BITS)
> > + /* I wonder if the compiler will be smart enough to loop-unroll
> > + * and optimize this... (no worries if not) --mq */
> > + for (i = ETHTOOL_DEV_FEATURE_WORDS; i-- > 0; ) {
> > + valid = (valid << 32)|features[i].valid;
> > + wanted = (wanted << 32)|features[i].requested;
> > + }
> [...]
>
> I don't know (or care) about optimisation of this, but I would expect
> gcc to complain about shifting a 32-bit value by 32 bits. I suggest you
> write this as:
>
> for (i = 0; i < ETHTOOL_DEV_FEATURE_WORDS; ++i) {
> valid |= (netdev_features_t)features[i].valid << 32 *i;
> wanted |= (netdev_features_t)features[i].requested << 32 *i;
It's a valid point but this type of typecast or similar usage would
imply that netdev_feature_t is an int of XXX bits. That's not opaque
and would hinder the way you can abstract the feature type.
--mahesh..
>
> }
>
> Ben.
>
> --
> Ben Hutchings, Senior Software Engineer, Solarflare
> Not speaking for my employer; that's the marketing department's job.
> They asked us to note that Solarflare product names are trademarked.
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [RFT PATCH 7/9] ethtool: prepare for larger netdev_features_t type
From: Ben Hutchings @ 2011-06-23 18:03 UTC (permalink / raw)
To: Mahesh Bandewar; +Cc: Michał Mirosław, netdev, David S. Miller
In-Reply-To: <BANLkTi=RB1MSR=c6GhXr4bsrPtFJVZnaZ8ZLCN=o339S_BE7iw@mail.gmail.com>
On Thu, 2011-06-23 at 10:50 -0700, Mahesh Bandewar wrote:
> On Mon, Jun 20, 2011 at 2:16 PM, Ben Hutchings
> <bhutchings@solarflare.com> wrote:
> >
> > On Mon, 2011-06-20 at 21:14 +0200, Michał Mirosław wrote:
> > [...]
> > > @@ -125,19 +131,26 @@ static int ethtool_set_features(struct net_device *dev, void __user *useraddr)
> > > if (copy_from_user(features, useraddr, sizeof(features)))
> > > return -EFAULT;
> > >
> > > - if (features[0].valid & ~NETIF_F_ETHTOOL_BITS)
> > > + /* I wonder if the compiler will be smart enough to loop-unroll
> > > + * and optimize this... (no worries if not) --mq */
> > > + for (i = ETHTOOL_DEV_FEATURE_WORDS; i-- > 0; ) {
> > > + valid = (valid << 32)|features[i].valid;
> > > + wanted = (wanted << 32)|features[i].requested;
> > > + }
> > [...]
> >
> > I don't know (or care) about optimisation of this, but I would expect
> > gcc to complain about shifting a 32-bit value by 32 bits. I suggest you
> > write this as:
> >
> > for (i = 0; i < ETHTOOL_DEV_FEATURE_WORDS; ++i) {
> > valid |= (netdev_features_t)features[i].valid << 32 *i;
> > wanted |= (netdev_features_t)features[i].requested << 32 *i;
>
> It's a valid point but this type of typecast or similar usage would
> imply that netdev_feature_t is an int of XXX bits. That's not opaque
> and would hinder the way you can abstract the feature type.
Yes, ethtool_{get,set}_features() will have to be changed if and when
the representation of netdev_features_t is changed significantly. I
don't think there's any way of avoiding that and I don't think it really
matters.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH 0/8] 8390: Neatening
From: Geert Uytterhoeven @ 2011-06-23 18:04 UTC (permalink / raw)
To: Joe Perches; +Cc: netdev, linux-kernel
In-Reply-To: <cover.1308810463.git.joe@perches.com>
On Thu, Jun 23, 2011 at 08:38, Joe Perches <joe@perches.com> wrote:
> Some updates requested by Geert Uytterhoeven
>
> Joe Perches (8):
> ariadne: Update style, neaten, restructure to eliminate prototypes
> a2065: Use pr_fmt, pr_<level> and netdev_<level>
> lib8390: Use pr_<level> and netdev_<level>
> lib8390: Indent braces appropriately
> lib8390: Normalize source code spacing
> lib8390: Convert include <asm to include <linux
> lib8390: Remove unnecessary extern
> zorro8390: Restructure and eliminate prototypes
Looks good. I had to make some minor adjustments to make it apply to my
current tree, though.
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Thanks!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* [net-2.6 PATCH 3/3] qlge:Version change to v1.00.00.29
From: Ron Mercer @ 2011-06-23 17:52 UTC (permalink / raw)
To: davem; +Cc: netdev, ron.mercer, jitendra.kalsaria, ameen.rahman
In-Reply-To: <1308851544-25719-1-git-send-email-ron.mercer@qlogic.com>
From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
---
drivers/net/qlge/qlge.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h
index b2c8612..ca306fd 100644
--- a/drivers/net/qlge/qlge.h
+++ b/drivers/net/qlge/qlge.h
@@ -16,7 +16,7 @@
*/
#define DRV_NAME "qlge"
#define DRV_STRING "QLogic 10 Gigabit PCI-E Ethernet Driver "
-#define DRV_VERSION "v1.00.00.27.00.00-01"
+#define DRV_VERSION "v1.00.00.29.00.00-01"
#define WQ_ADDR_ALIGN 0x3 /* 4 byte alignment */
--
1.6.0.2
^ permalink raw reply related
* [net-2.6 PATCH 2/3] qlge:Fix printk priority so chip fatal errors are always reported.
From: Ron Mercer @ 2011-06-23 17:52 UTC (permalink / raw)
To: davem; +Cc: netdev, ron.mercer, jitendra.kalsaria, ameen.rahman
In-Reply-To: <1308851544-25719-1-git-send-email-ron.mercer@qlogic.com>
From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Precedence of the printk should be at higher level so chip
fatal errors are always reported.
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
---
drivers/net/qlge/qlge_main.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 4fbefcf..66274ab 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -2170,7 +2170,7 @@ static void ql_process_chip_ae_intr(struct ql_adapter *qdev,
return;
case CAM_LOOKUP_ERR_EVENT:
- netif_err(qdev, link, qdev->ndev,
+ netif_err(qdev, drv, qdev->ndev,
"Multiple CAM hits lookup occurred.\n");
netif_err(qdev, drv, qdev->ndev,
"This event shouldn't occur.\n");
@@ -2178,13 +2178,13 @@ static void ql_process_chip_ae_intr(struct ql_adapter *qdev,
return;
case SOFT_ECC_ERROR_EVENT:
- netif_err(qdev, rx_err, qdev->ndev,
+ netif_err(qdev, drv, qdev->ndev,
"Soft ECC error detected.\n");
ql_queue_asic_error(qdev);
break;
case PCI_ERR_ANON_BUF_RD:
- netif_err(qdev, rx_err, qdev->ndev,
+ netif_err(qdev, drv, qdev->ndev,
"PCI error occurred when reading anonymous buffers from rx_ring %d.\n",
ib_ae_rsp->q_id);
ql_queue_asic_error(qdev);
@@ -2441,10 +2441,10 @@ static irqreturn_t qlge_isr(int irq, void *dev_id)
*/
if (var & STS_FE) {
ql_queue_asic_error(qdev);
- netif_err(qdev, intr, qdev->ndev,
+ netif_err(qdev, drv, qdev->ndev,
"Got fatal error, STS = %x.\n", var);
var = ql_read32(qdev, ERR_STS);
- netif_err(qdev, intr, qdev->ndev,
+ netif_err(qdev, drv, qdev->ndev,
"Resetting chip. Error Status Register = 0x%x\n", var);
return IRQ_HANDLED;
}
--
1.6.0.2
^ permalink raw reply related
* [net-2.6 PATCH 1/3] qlge:Fix crash caused by mailbox execution on wedged chip.
From: Ron Mercer @ 2011-06-23 17:52 UTC (permalink / raw)
To: davem; +Cc: netdev, ron.mercer, jitendra.kalsaria, ameen.rahman
From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
When we are in a recover process from a chip fatal error,
driver should skip over execution of mailbox commands during
resetting chip.
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
---
drivers/net/qlge/qlge.h | 1 +
drivers/net/qlge/qlge_main.c | 20 +++++++++++++++-----
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h
index d328507..b2c8612 100644
--- a/drivers/net/qlge/qlge.h
+++ b/drivers/net/qlge/qlge.h
@@ -1996,6 +1996,7 @@ enum {
QL_LB_LINK_UP = 10,
QL_FRC_COREDUMP = 11,
QL_EEH_FATAL = 12,
+ QL_ASIC_RECOVERY = 14, /* We are in ascic recovery. */
};
/* link_status bit definitions */
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 930ae45..4fbefcf 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -2152,6 +2152,10 @@ void ql_queue_asic_error(struct ql_adapter *qdev)
* thread
*/
clear_bit(QL_ADAPTER_UP, &qdev->flags);
+ /* Set asic recovery bit to indicate reset process that we are
+ * in fatal error recovery process rather than normal close
+ */
+ set_bit(QL_ASIC_RECOVERY, &qdev->flags);
queue_delayed_work(qdev->workqueue, &qdev->asic_reset_work, 0);
}
@@ -3818,11 +3822,17 @@ static int ql_adapter_reset(struct ql_adapter *qdev)
end_jiffies = jiffies +
max((unsigned long)1, usecs_to_jiffies(30));
- /* Stop management traffic. */
- ql_mb_set_mgmnt_traffic_ctl(qdev, MB_SET_MPI_TFK_STOP);
+ /* Check if bit is set then skip the mailbox command and
+ * clear the bit, else we are in normal reset process.
+ */
+ if (!test_bit(QL_ASIC_RECOVERY, &qdev->flags)) {
+ /* Stop management traffic. */
+ ql_mb_set_mgmnt_traffic_ctl(qdev, MB_SET_MPI_TFK_STOP);
- /* Wait for the NIC and MGMNT FIFOs to empty. */
- ql_wait_fifo_empty(qdev);
+ /* Wait for the NIC and MGMNT FIFOs to empty. */
+ ql_wait_fifo_empty(qdev);
+ } else
+ clear_bit(QL_ASIC_RECOVERY, &qdev->flags);
ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR);
--
1.6.0.2
^ permalink raw reply related
* Re: linux-next: Tree for June 23 (net)
From: Mike Frysinger @ 2011-06-23 18:13 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Stephen Rothwell, netdev, linux-next, LKML
In-Reply-To: <20110623091429.2d51b0f0.randy.dunlap@oracle.com>
On Thu, Jun 23, 2011 at 12:14, Randy Dunlap wrote:
> On Thu, 23 Jun 2011 15:54:31 +1000 Stephen Rothwell wrote:
>> Hi all,
>>
>> Changes since 20110622:
>>
>> The powerpc allyesconfig (and probably others) is still broken because we
>> now build the staging drivers and because of a commit in the net tree.
>> The breakage in Linus' tree is fixed by one of Andrew's patches above.
>>
>> The net tree gained 2 build failures that I have left (see above).
>
>
> When CONFIG_INET is not enabled:
>
> net/core/dev.c:2535: error: implicit declaration of function 'ip_is_fragment'
i see this on two Blackfin defconfigs like CM-BF533
-mike
^ permalink raw reply
* Re: [RFT PATCH 7/9] ethtool: prepare for larger netdev_features_t type
From: Mahesh Bandewar @ 2011-06-23 18:21 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Michał Mirosław, netdev, David S. Miller
In-Reply-To: <1308852228.2712.5.camel@bwh-desktop>
On Thu, Jun 23, 2011 at 11:03 AM, Ben Hutchings
<bhutchings@solarflare.com> wrote:
> On Thu, 2011-06-23 at 10:50 -0700, Mahesh Bandewar wrote:
>> On Mon, Jun 20, 2011 at 2:16 PM, Ben Hutchings
>> <bhutchings@solarflare.com> wrote:
>> >
>> > On Mon, 2011-06-20 at 21:14 +0200, Michał Mirosław wrote:
>> > [...]
>> > > @@ -125,19 +131,26 @@ static int ethtool_set_features(struct net_device *dev, void __user *useraddr)
>> > > if (copy_from_user(features, useraddr, sizeof(features)))
>> > > return -EFAULT;
>> > >
>> > > - if (features[0].valid & ~NETIF_F_ETHTOOL_BITS)
>> > > + /* I wonder if the compiler will be smart enough to loop-unroll
>> > > + * and optimize this... (no worries if not) --mq */
>> > > + for (i = ETHTOOL_DEV_FEATURE_WORDS; i-- > 0; ) {
>> > > + valid = (valid << 32)|features[i].valid;
>> > > + wanted = (wanted << 32)|features[i].requested;
>> > > + }
>> > [...]
>> >
>> > I don't know (or care) about optimisation of this, but I would expect
>> > gcc to complain about shifting a 32-bit value by 32 bits. I suggest you
>> > write this as:
>> >
>> > for (i = 0; i < ETHTOOL_DEV_FEATURE_WORDS; ++i) {
>> > valid |= (netdev_features_t)features[i].valid << 32 *i;
>> > wanted |= (netdev_features_t)features[i].requested << 32 *i;
>>
>> It's a valid point but this type of typecast or similar usage would
>> imply that netdev_feature_t is an int of XXX bits. That's not opaque
>> and would hinder the way you can abstract the feature type.
>
> Yes, ethtool_{get,set}_features() will have to be changed if and when
> the representation of netdev_features_t is changed significantly. I
> don't think there's any way of avoiding that and I don't think it really
> matters.
>
Well, if you have a conversion routine that converts (whatever the)
netdev_type_t type is to the ethtool representation (array of u32 for
example). So the changes would have to be done in that conversion
routine only and not get/set_features() ethtool methods as such.
--mahesh..
> Ben.
>
> --
> Ben Hutchings, Senior Software Engineer, Solarflare
> Not speaking for my employer; that's the marketing department's job.
> They asked us to note that Solarflare product names are trademarked.
>
>
^ permalink raw reply
* Re: [PATCH 1/3] serial/imx: add device tree support
From: Shawn Guo @ 2011-06-23 18:38 UTC (permalink / raw)
To: Grant Likely
Cc: patches, netdev, devicetree-discuss, Jason Liu, linux-kernel,
Jeremy Kerr, Sascha Hauer, linux-arm-kernel, David Gibson
In-Reply-To: <BANLkTim4vunTm1176MRw3pqRZnunu4=9jg@mail.gmail.com>
On Tue, Jun 21, 2011 at 01:13:50PM -0600, Grant Likely wrote:
[...]
> >
> > /**
> > + * of_get_device_index - Get device index by looking up "aliases" node
> > + * @np: Pointer to device node that asks for device index
> > + * @name: The device alias without index number
> > + *
> > + * Returns the device index if find it, else returns -ENODEV.
> > + */
> > +int of_get_device_index(struct device_node *np, const char *alias)
> > +{
> > + struct device_node *aliases = of_find_node_by_name(NULL, "aliases");
> > + struct property *prop;
> > + char name[32];
> > + int index = 0;
> > +
> > + if (!aliases)
> > + return -ENODEV;
> > +
> > + while (1) {
> > + snprintf(name, sizeof(name), "%s%d", alias, index);
> > + prop = of_find_property(aliases, name, NULL);
> > + if (!prop)
> > + return -ENODEV;
> > + if (np == of_find_node_by_path(prop->value))
> > + break;
> > + index++;
> > + }
>
> Rather than parsing the alias strings everytime, it would probably be
> better to preprocess all the properties in the aliases node and create
> a lookup table of alias->node references that can be walked quickly
> and trivially.
>
> Also, when obtaining an enumeration for a device, you'll need to be
> careful about what number gets returned. If the node doesn't match a
> given alias, but aliases do exist for other devices of like type, then
> you need to be careful not to assign a number already assigned to
> another device via an alias (this of course assumes the driver
> supports dynamics enumeration, which many drivers will). It would be
>
Grant, please take a look at the second shot below. Please let me
know what you think.
diff --git a/arch/arm/boot/dts/imx51-babbage.dts b/arch/arm/boot/dts/imx51-babbage.dts
index 7976932..f4a5c3c 100644
--- a/arch/arm/boot/dts/imx51-babbage.dts
+++ b/arch/arm/boot/dts/imx51-babbage.dts
@@ -18,6 +18,12 @@
compatible = "fsl,imx51-babbage", "fsl,imx51";
interrupt-parent = <&tzic>;
+ aliases {
+ serial0 = &uart0;
+ serial1 = &uart1;
+ serial2 = &uart2;
+ };
+
chosen {
bootargs = "console=ttymxc0,115200 root=/dev/mmcblk0p3 rootwait";
};
@@ -47,29 +53,29 @@
reg = <0x70000000 0x40000>;
ranges;
- uart@7000c000 {
- compatible = "fsl,imx51-uart", "fsl,imx-uart";
+ uart2: uart@7000c000 {
+ compatible = "fsl,imx51-uart", "fsl,imx21-uart";
reg = <0x7000c000 0x4000>;
interrupts = <33>;
id = <3>;
fsl,has-rts-cts;
};
};
- uart@73fbc000 {
- compatible = "fsl,imx51-uart", "fsl,imx-uart";
+ uart0: uart@73fbc000 {
+ compatible = "fsl,imx51-uart", "fsl,imx21-uart";
reg = <0x73fbc000 0x4000>;
interrupts = <31>;
id = <1>;
fsl,has-rts-cts;
};
- uart@73fc0000 {
- compatible = "fsl,imx51-uart", "fsl,imx-uart";
+ uart1: uart@73fc0000 {
+ compatible = "fsl,imx51-uart", "fsl,imx21-uart";
reg = <0x73fc0000 0x4000>;
interrupts = <32>;
id = <2>;
fsl,has-rts-cts;
};
};
diff --git a/arch/arm/mach-mx5/imx51-dt.c b/arch/arm/mach-mx5/imx51-dt.c
index 8bfdb91..e6c7298 100644
--- a/arch/arm/mach-mx5/imx51-dt.c
+++ b/arch/arm/mach-mx5/imx51-dt.c
@@ -40,6 +40,8 @@ static const struct of_device_id tzic_of_match[] __initconst = {
static void __init imx51_dt_init(void)
{
+ of_scan_aliases();
+
irq_domain_generate_simple(tzic_of_match, MX51_TZIC_BASE_ADDR, 0);
of_platform_populate(NULL, of_default_bus_match_table,
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 632ebae..90349a2 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -17,12 +17,27 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/ctype.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/proc_fs.h>
+struct alias_devname {
+ char devname[32];
+ struct list_head link;
+ struct list_head head;
+};
+
+struct alias_devid {
+ int devid;
+ struct device_node *node;
+ struct list_head link;
+};
+
+static LIST_HEAD(aliases_lookup);
+
struct device_node *allnodes;
struct device_node *of_chosen;
@@ -922,3 +937,170 @@ out_unlock:
}
#endif /* defined(CONFIG_OF_DYNAMIC) */
+/*
+ * get_alias_dev_name_id - Get device name and id from alias name
+ *
+ * an: The alias name passed in
+ * dn: The pointer used to return device name
+ *
+ * Returns device id which should be the number at the end of alias
+ * name, otherwise returns -1.
+ */
+static int get_alias_name_id(char *an, char *dn)
+{
+ int len = strlen(an);
+ char *end = an + len;
+
+ while (isdigit(*--end))
+ len--;
+
+ end++;
+ strncpy(dn, an, len);
+ dn[len] = '\0';
+
+ return strlen(end) ? simple_strtol(end, NULL, 10) : -1;
+}
+
+/*
+ * get_an_available_devid - Get an available devid for the given devname
+ *
+ * adn: The pointer to the given alias_devname
+ *
+ * Returns the available devid
+ */
+static int get_an_available_devid(struct alias_devname *adn)
+{
+ int devid = 0;
+ struct alias_devid *adi;
+
+ while (1) {
+ bool used = false;
+ list_for_each_entry(adi, &adn->head, link) {
+ if (adi->devid == devid) {
+ used = true;
+ break;
+ }
+ }
+
+ if (!used)
+ break;
+
+ devid++;
+ }
+
+ return devid;
+}
+
+/*
+ * of_scan_aliases - Scan all properties of aliases node and populate the
+ * global lookup table with the device name and id info
+ *
+ * Returns the number of aliases properties found, or error code in error case.
+ */
+int of_scan_aliases(void)
+{
+ struct device_node *aliases = of_find_node_by_name(NULL, "aliases");
+ struct property *pp;
+ struct alias_devname *adn;
+ struct alias_devid *adi;
+ int ret = 0;
+
+ if (!aliases) {
+ ret = -ENODEV;
+ goto out;
+ }
+
+ for (pp = aliases->properties; pp != NULL; pp = pp->next) {
+ bool found = false;
+ char devname[32];
+ int devid = get_alias_name_id(pp->name, devname);
+
+ /* We do not want to proceed this sentinel one */
+ if (!strcmp(pp->name, "name") && !strcmp(pp->value, "aliases"))
+ break;
+
+ /* See if the devname already exists */
+ list_for_each_entry(adn, &aliases_lookup, link) {
+ if (!strcmp(adn->devname, devname)) {
+ found = true;
+ break;
+ }
+ }
+
+ /*
+ * Create the entry for this devname if not found,
+ * and add it into aliases_lookup
+ */
+ if (!found) {
+ adn = kzalloc(sizeof(*adn), GFP_KERNEL);
+ if (!adn) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ strcpy(adn->devname, devname);
+ INIT_LIST_HEAD(&adn->head);
+ list_add_tail(&adn->link, &aliases_lookup);
+ }
+
+ /*
+ * Save the devid as one entry of the list for this
+ * specified devname
+ */
+ adi = kzalloc(sizeof(*adi), GFP_KERNEL);
+ if (!adi) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ adi->devid = (devid == -1) ? get_an_available_devid(adn) :
+ devid;
+ adi->node = of_find_node_by_path(pp->value);
+
+ list_add_tail(&adi->link, &adn->head);
+ ret++;
+ }
+
+out:
+ return ret;
+}
+
+/**
+ * of_get_device_id - Get device id by looking up "aliases" node
+ * @np: Pointer to device node that asks for device id
+ * @name: The device alias name
+ *
+ * Returns the device id if find it, else returns -ENODEV.
+ */
+int of_get_device_id(struct device_node *np, const char *name)
+{
+ struct alias_devname *adn;
+ struct alias_devid *adi;
+ bool found = false;
+ int ret;
+
+ list_for_each_entry(adn, &aliases_lookup, link) {
+ if (!strcmp(adn->devname, name)) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ ret = -ENODEV;
+ goto out;
+ }
+
+ found = false;
+ list_for_each_entry(adi, &adn->head, link) {
+ if (np == adi->node) {
+ found = true;
+ break;
+ }
+ }
+
+ ret = found ? adi->devid : -ENODEV;
+out:
+ return ret;
+}
+EXPORT_SYMBOL(of_get_device_id);
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 2769353..062639e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1225,43 +1265,33 @@ static int serial_imx_resume(struct platform_device *dev)
return 0;
}
static int serial_imx_probe_dt(struct imx_port *sport,
struct platform_device *pdev)
{
struct device_node *node = pdev->dev.of_node;
- const __be32 *line;
+ int line;
if (!node)
return -ENODEV;
- line = of_get_property(node, "id", NULL);
- if (!line)
+ line = of_get_device_id(node, "serial");
+ if (IS_ERR_VALUE(line))
return -ENODEV;
- sport->port.line = be32_to_cpup(line) - 1;
+ sport->port.line = line;
diff --git a/include/linux/of.h b/include/linux/of.h
index bfc0ed1..270c671 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -213,6 +213,9 @@ extern int of_parse_phandles_with_args(struct device_node *np,
const char *list_name, const char *cells_name, int index,
struct device_node **out_node, const void **out_args);
+extern int of_scan_aliases(void);
+extern int of_get_device_id(struct device_node *np, const char *name);
+
extern int of_machine_is_compatible(const char *compat);
extern int prom_add_property(struct device_node* np, struct property* prop);
--
Regards,
Shawn
^ permalink raw reply related
* Re: [net-2.6 PATCH 2/3] qlge:Fix printk priority so chip fatal errors are always reported.
From: Joe Perches @ 2011-06-23 18:50 UTC (permalink / raw)
To: Ron Mercer; +Cc: davem, netdev, jitendra.kalsaria, ameen.rahman
In-Reply-To: <1308851544-25719-2-git-send-email-ron.mercer@qlogic.com>
On Thu, 2011-06-23 at 10:52 -0700, Ron Mercer wrote:
> From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
> Precedence of the printk should be at higher level so chip
> fatal errors are always reported.
You probably want to use netdev_err then, not a masked
netif_err when it is optionally not reported.
> diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
[]
> @@ -2170,7 +2170,7 @@ static void ql_process_chip_ae_intr(struct ql_adapter *qdev,
> return;
>
> case CAM_LOOKUP_ERR_EVENT:
> - netif_err(qdev, link, qdev->ndev,
> + netif_err(qdev, drv, qdev->ndev,
> "Multiple CAM hits lookup occurred.\n");
netdev_err(qdev->ndev, "Multiple CAM hits lookup occurred\n");
> @@ -2178,13 +2178,13 @@ static void ql_process_chip_ae_intr(struct ql_adapter *qdev,
> return;
>
> case SOFT_ECC_ERROR_EVENT:
> - netif_err(qdev, rx_err, qdev->ndev,
> + netif_err(qdev, drv, qdev->ndev,
> "Soft ECC error detected.\n");
netdev_err(qdev->ndev, "Soft ECC error detected\n");
etc...
^ permalink raw reply
* Re: [RFT PATCH 7/9] ethtool: prepare for larger netdev_features_t type
From: Ben Hutchings @ 2011-06-23 18:55 UTC (permalink / raw)
To: Mahesh Bandewar; +Cc: Michał Mirosław, netdev, David S. Miller
In-Reply-To: <BANLkTikTquu8jr7U-8s=8kQcqT86Ji1MqnSKug+3zQdgsVKxKA@mail.gmail.com>
On Thu, 2011-06-23 at 11:21 -0700, Mahesh Bandewar wrote:
> On Thu, Jun 23, 2011 at 11:03 AM, Ben Hutchings
> <bhutchings@solarflare.com> wrote:
> > On Thu, 2011-06-23 at 10:50 -0700, Mahesh Bandewar wrote:
> >> On Mon, Jun 20, 2011 at 2:16 PM, Ben Hutchings
> >> <bhutchings@solarflare.com> wrote:
> >> >
> >> > On Mon, 2011-06-20 at 21:14 +0200, Michał Mirosław wrote:
> >> > [...]
> >> > > @@ -125,19 +131,26 @@ static int ethtool_set_features(struct net_device *dev, void __user *useraddr)
> >> > > if (copy_from_user(features, useraddr, sizeof(features)))
> >> > > return -EFAULT;
> >> > >
> >> > > - if (features[0].valid & ~NETIF_F_ETHTOOL_BITS)
> >> > > + /* I wonder if the compiler will be smart enough to loop-unroll
> >> > > + * and optimize this... (no worries if not) --mq */
> >> > > + for (i = ETHTOOL_DEV_FEATURE_WORDS; i-- > 0; ) {
> >> > > + valid = (valid << 32)|features[i].valid;
> >> > > + wanted = (wanted << 32)|features[i].requested;
> >> > > + }
> >> > [...]
> >> >
> >> > I don't know (or care) about optimisation of this, but I would expect
> >> > gcc to complain about shifting a 32-bit value by 32 bits. I suggest you
> >> > write this as:
> >> >
> >> > for (i = 0; i < ETHTOOL_DEV_FEATURE_WORDS; ++i) {
> >> > valid |= (netdev_features_t)features[i].valid << 32 *i;
> >> > wanted |= (netdev_features_t)features[i].requested << 32 *i;
> >>
> >> It's a valid point but this type of typecast or similar usage would
> >> imply that netdev_feature_t is an int of XXX bits. That's not opaque
> >> and would hinder the way you can abstract the feature type.
> >
> > Yes, ethtool_{get,set}_features() will have to be changed if and when
> > the representation of netdev_features_t is changed significantly. I
> > don't think there's any way of avoiding that and I don't think it really
> > matters.
> >
> Well, if you have a conversion routine that converts (whatever the)
> netdev_type_t type is to the ethtool representation (array of u32 for
> example). So the changes would have to be done in that conversion
> routine only and not get/set_features() ethtool methods as such.
These are precisely those conversion routines, because there is no other
place that needs to deal with the ethtool representation...
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [net-2.6 PATCH 2/3] qlge:Fix printk priority so chip fatal errors are always reported.
From: Ron Mercer @ 2011-06-23 18:43 UTC (permalink / raw)
To: Joe Perches; +Cc: David Miller, netdev, Jitendra Kalsaria, Ameen Rahman
In-Reply-To: <1308855049.6688.19.camel@Joe-Laptop>
On Thu, Jun 23, 2011 at 11:50:49AM -0700, Joe Perches wrote:
> On Thu, 2011-06-23 at 10:52 -0700, Ron Mercer wrote:
> > From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
> > Precedence of the printk should be at higher level so chip
> > fatal errors are always reported.
>
> You probably want to use netdev_err then, not a masked
> netif_err when it is optionally not reported.
>
Thanks. We will respin these after waiting a bit for more comments.
^ permalink raw reply
* Re: [PATCH 4/5] pm: move pm notifiers into suspend.h
From: Pavel Machek @ 2011-06-23 20:24 UTC (permalink / raw)
To: Cong Wang
Cc: Rafael J. Wysocki, linux-kernel, akpm, netdev, Chris Ball,
Len Brown, Ohad Ben-Cohen, Linus Walleij, Philip Rakity,
David S. Miller, Lucas De Marchi, Paul E. McKenney, Josh Triplett,
linux-mmc, linux-pm
In-Reply-To: <4E02C93A.7010601@redhat.com>
On Thu 2011-06-23 13:03:54, Cong Wang wrote:
> ??? 2011???06???23??? 03:49, Rafael J. Wysocki ??????:
> >>+#ifdef CONFIG_PM
> >>> +#include<linux/suspend.h>
> >>> +#endif
> >I don't think the #ifdef in necessary. Any dependencies on CONFIG_PM
> >(or CONFIG_SUSPEND etc.) should be taken care of inside of suspend.h.
> >This file should be fixed if they aren't.
> >
>
> Ok, please check the updated version below.
>
> Thanks.
>
> Author: Amerigo Wang <amwang@redhat.com>
>
> pm: move pm notifiers into suspend.h
>
> Signed-off-by: WANG Cong <amwang@redhat.com>
ACK.
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply
* [PATCH 1/2] can: bfin_can: simplify xmit id1 setup
From: Mike Frysinger @ 2011-06-23 20:36 UTC (permalink / raw)
To: socketcan-core, Urs Thuermann, Oliver Hartkopp, netdev,
David S. Miller
Cc: uclinux-dist-devel
If we look closely, the 4 writes to TRANSMIT_CHL.id1 can be collapsed
down into much simpler code. So do just that.
This also fixes a build failure due to the I/O macros no longer
getting pulled in. Their minor (and accidental) usage here gets
dropped as part of the unification.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
drivers/net/can/bfin_can.c | 21 ++++++---------------
1 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c
index b6e890d..dc6ef4a 100644
--- a/drivers/net/can/bfin_can.c
+++ b/drivers/net/can/bfin_can.c
@@ -243,21 +243,12 @@ static int bfin_can_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* fill id */
if (id & CAN_EFF_FLAG) {
bfin_write16(®->chl[TRANSMIT_CHL].id0, id);
- if (id & CAN_RTR_FLAG)
- writew(((id & 0x1FFF0000) >> 16) | IDE | AME | RTR,
- ®->chl[TRANSMIT_CHL].id1);
- else
- writew(((id & 0x1FFF0000) >> 16) | IDE | AME,
- ®->chl[TRANSMIT_CHL].id1);
-
- } else {
- if (id & CAN_RTR_FLAG)
- writew((id << 2) | AME | RTR,
- ®->chl[TRANSMIT_CHL].id1);
- else
- bfin_write16(®->chl[TRANSMIT_CHL].id1,
- (id << 2) | AME);
- }
+ val = ((id & 0x1FFF0000) >> 16) | IDE;
+ } else
+ val = (id << 2);
+ if (id & CAN_RTR_FLAG)
+ val |= RTR;
+ bfin_write16(®->chl[TRANSMIT_CHL].id1, val | AME);
/* fill payload */
for (i = 0; i < 8; i += 2) {
--
1.7.5.3
^ permalink raw reply related
* [PATCH 2/2] can: bfin_can: auto-calculate accessor sizes
From: Mike Frysinger @ 2011-06-23 20:36 UTC (permalink / raw)
To: socketcan-core, Urs Thuermann, Oliver Hartkopp, netdev,
David S. Miller
Cc: uclinux-dist-devel
In-Reply-To: <1308861380-27485-1-git-send-email-vapier@gentoo.org>
Since we have a struct that defines the sizes of the registers, we don't
need to explicitly use the 16bit read/write helpers. Let the code figure
out which size access to make based on the size of the C type.
There should be no functional changes here.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
drivers/net/can/bfin_can.c | 118 ++++++++++++++++++++++----------------------
1 files changed, 59 insertions(+), 59 deletions(-)
diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c
index dc6ef4a..a1c5abc 100644
--- a/drivers/net/can/bfin_can.c
+++ b/drivers/net/can/bfin_can.c
@@ -79,8 +79,8 @@ static int bfin_can_set_bittiming(struct net_device *dev)
if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES)
timing |= SAM;
- bfin_write16(®->clock, clk);
- bfin_write16(®->timing, timing);
+ bfin_write(®->clock, clk);
+ bfin_write(®->timing, timing);
dev_info(dev->dev.parent, "setting CLOCK=0x%04x TIMING=0x%04x\n",
clk, timing);
@@ -96,16 +96,16 @@ static void bfin_can_set_reset_mode(struct net_device *dev)
int i;
/* disable interrupts */
- bfin_write16(®->mbim1, 0);
- bfin_write16(®->mbim2, 0);
- bfin_write16(®->gim, 0);
+ bfin_write(®->mbim1, 0);
+ bfin_write(®->mbim2, 0);
+ bfin_write(®->gim, 0);
/* reset can and enter configuration mode */
- bfin_write16(®->control, SRS | CCR);
+ bfin_write(®->control, SRS | CCR);
SSYNC();
- bfin_write16(®->control, CCR);
+ bfin_write(®->control, CCR);
SSYNC();
- while (!(bfin_read16(®->control) & CCA)) {
+ while (!(bfin_read(®->control) & CCA)) {
udelay(10);
if (--timeout == 0) {
dev_err(dev->dev.parent,
@@ -119,33 +119,33 @@ static void bfin_can_set_reset_mode(struct net_device *dev)
* by writing to CAN Mailbox Configuration Registers 1 and 2
* For all bits: 0 - Mailbox disabled, 1 - Mailbox enabled
*/
- bfin_write16(®->mc1, 0);
- bfin_write16(®->mc2, 0);
+ bfin_write(®->mc1, 0);
+ bfin_write(®->mc2, 0);
/* Set Mailbox Direction */
- bfin_write16(®->md1, 0xFFFF); /* mailbox 1-16 are RX */
- bfin_write16(®->md2, 0); /* mailbox 17-32 are TX */
+ bfin_write(®->md1, 0xFFFF); /* mailbox 1-16 are RX */
+ bfin_write(®->md2, 0); /* mailbox 17-32 are TX */
/* RECEIVE_STD_CHL */
for (i = 0; i < 2; i++) {
- bfin_write16(®->chl[RECEIVE_STD_CHL + i].id0, 0);
- bfin_write16(®->chl[RECEIVE_STD_CHL + i].id1, AME);
- bfin_write16(®->chl[RECEIVE_STD_CHL + i].dlc, 0);
- bfin_write16(®->msk[RECEIVE_STD_CHL + i].amh, 0x1FFF);
- bfin_write16(®->msk[RECEIVE_STD_CHL + i].aml, 0xFFFF);
+ bfin_write(®->chl[RECEIVE_STD_CHL + i].id0, 0);
+ bfin_write(®->chl[RECEIVE_STD_CHL + i].id1, AME);
+ bfin_write(®->chl[RECEIVE_STD_CHL + i].dlc, 0);
+ bfin_write(®->msk[RECEIVE_STD_CHL + i].amh, 0x1FFF);
+ bfin_write(®->msk[RECEIVE_STD_CHL + i].aml, 0xFFFF);
}
/* RECEIVE_EXT_CHL */
for (i = 0; i < 2; i++) {
- bfin_write16(®->chl[RECEIVE_EXT_CHL + i].id0, 0);
- bfin_write16(®->chl[RECEIVE_EXT_CHL + i].id1, AME | IDE);
- bfin_write16(®->chl[RECEIVE_EXT_CHL + i].dlc, 0);
- bfin_write16(®->msk[RECEIVE_EXT_CHL + i].amh, 0x1FFF);
- bfin_write16(®->msk[RECEIVE_EXT_CHL + i].aml, 0xFFFF);
+ bfin_write(®->chl[RECEIVE_EXT_CHL + i].id0, 0);
+ bfin_write(®->chl[RECEIVE_EXT_CHL + i].id1, AME | IDE);
+ bfin_write(®->chl[RECEIVE_EXT_CHL + i].dlc, 0);
+ bfin_write(®->msk[RECEIVE_EXT_CHL + i].amh, 0x1FFF);
+ bfin_write(®->msk[RECEIVE_EXT_CHL + i].aml, 0xFFFF);
}
- bfin_write16(®->mc2, BIT(TRANSMIT_CHL - 16));
- bfin_write16(®->mc1, BIT(RECEIVE_STD_CHL) + BIT(RECEIVE_EXT_CHL));
+ bfin_write(®->mc2, BIT(TRANSMIT_CHL - 16));
+ bfin_write(®->mc1, BIT(RECEIVE_STD_CHL) + BIT(RECEIVE_EXT_CHL));
SSYNC();
priv->can.state = CAN_STATE_STOPPED;
@@ -160,9 +160,9 @@ static void bfin_can_set_normal_mode(struct net_device *dev)
/*
* leave configuration mode
*/
- bfin_write16(®->control, bfin_read16(®->control) & ~CCR);
+ bfin_write(®->control, bfin_read(®->control) & ~CCR);
- while (bfin_read16(®->status) & CCA) {
+ while (bfin_read(®->status) & CCA) {
udelay(10);
if (--timeout == 0) {
dev_err(dev->dev.parent,
@@ -174,25 +174,25 @@ static void bfin_can_set_normal_mode(struct net_device *dev)
/*
* clear _All_ tx and rx interrupts
*/
- bfin_write16(®->mbtif1, 0xFFFF);
- bfin_write16(®->mbtif2, 0xFFFF);
- bfin_write16(®->mbrif1, 0xFFFF);
- bfin_write16(®->mbrif2, 0xFFFF);
+ bfin_write(®->mbtif1, 0xFFFF);
+ bfin_write(®->mbtif2, 0xFFFF);
+ bfin_write(®->mbrif1, 0xFFFF);
+ bfin_write(®->mbrif2, 0xFFFF);
/*
* clear global interrupt status register
*/
- bfin_write16(®->gis, 0x7FF); /* overwrites with '1' */
+ bfin_write(®->gis, 0x7FF); /* overwrites with '1' */
/*
* Initialize Interrupts
* - set bits in the mailbox interrupt mask register
* - global interrupt mask
*/
- bfin_write16(®->mbim1, BIT(RECEIVE_STD_CHL) + BIT(RECEIVE_EXT_CHL));
- bfin_write16(®->mbim2, BIT(TRANSMIT_CHL - 16));
+ bfin_write(®->mbim1, BIT(RECEIVE_STD_CHL) + BIT(RECEIVE_EXT_CHL));
+ bfin_write(®->mbim2, BIT(TRANSMIT_CHL - 16));
- bfin_write16(®->gim, EPIM | BOIM | RMLIM);
+ bfin_write(®->gim, EPIM | BOIM | RMLIM);
SSYNC();
}
@@ -242,28 +242,28 @@ static int bfin_can_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* fill id */
if (id & CAN_EFF_FLAG) {
- bfin_write16(®->chl[TRANSMIT_CHL].id0, id);
+ bfin_write(®->chl[TRANSMIT_CHL].id0, id);
val = ((id & 0x1FFF0000) >> 16) | IDE;
} else
val = (id << 2);
if (id & CAN_RTR_FLAG)
val |= RTR;
- bfin_write16(®->chl[TRANSMIT_CHL].id1, val | AME);
+ bfin_write(®->chl[TRANSMIT_CHL].id1, val | AME);
/* fill payload */
for (i = 0; i < 8; i += 2) {
val = ((7 - i) < dlc ? (data[7 - i]) : 0) +
((6 - i) < dlc ? (data[6 - i] << 8) : 0);
- bfin_write16(®->chl[TRANSMIT_CHL].data[i], val);
+ bfin_write(®->chl[TRANSMIT_CHL].data[i], val);
}
/* fill data length code */
- bfin_write16(®->chl[TRANSMIT_CHL].dlc, dlc);
+ bfin_write(®->chl[TRANSMIT_CHL].dlc, dlc);
can_put_echo_skb(skb, dev, 0);
/* set transmit request */
- bfin_write16(®->trs2, BIT(TRANSMIT_CHL - 16));
+ bfin_write(®->trs2, BIT(TRANSMIT_CHL - 16));
return 0;
}
@@ -286,26 +286,26 @@ static void bfin_can_rx(struct net_device *dev, u16 isrc)
/* get id */
if (isrc & BIT(RECEIVE_EXT_CHL)) {
/* extended frame format (EFF) */
- cf->can_id = ((bfin_read16(®->chl[RECEIVE_EXT_CHL].id1)
+ cf->can_id = ((bfin_read(®->chl[RECEIVE_EXT_CHL].id1)
& 0x1FFF) << 16)
- + bfin_read16(®->chl[RECEIVE_EXT_CHL].id0);
+ + bfin_read(®->chl[RECEIVE_EXT_CHL].id0);
cf->can_id |= CAN_EFF_FLAG;
obj = RECEIVE_EXT_CHL;
} else {
/* standard frame format (SFF) */
- cf->can_id = (bfin_read16(®->chl[RECEIVE_STD_CHL].id1)
+ cf->can_id = (bfin_read(®->chl[RECEIVE_STD_CHL].id1)
& 0x1ffc) >> 2;
obj = RECEIVE_STD_CHL;
}
- if (bfin_read16(®->chl[obj].id1) & RTR)
+ if (bfin_read(®->chl[obj].id1) & RTR)
cf->can_id |= CAN_RTR_FLAG;
/* get data length code */
- cf->can_dlc = get_can_dlc(bfin_read16(®->chl[obj].dlc) & 0xF);
+ cf->can_dlc = get_can_dlc(bfin_read(®->chl[obj].dlc) & 0xF);
/* get payload */
for (i = 0; i < 8; i += 2) {
- val = bfin_read16(®->chl[obj].data[i]);
+ val = bfin_read(®->chl[obj].data[i]);
cf->data[7 - i] = (7 - i) < cf->can_dlc ? val : 0;
cf->data[6 - i] = (6 - i) < cf->can_dlc ? (val >> 8) : 0;
}
@@ -359,7 +359,7 @@ static int bfin_can_err(struct net_device *dev, u16 isrc, u16 status)
if (state != priv->can.state && (state == CAN_STATE_ERROR_WARNING ||
state == CAN_STATE_ERROR_PASSIVE)) {
- u16 cec = bfin_read16(®->cec);
+ u16 cec = bfin_read(®->cec);
u8 rxerr = cec;
u8 txerr = cec >> 8;
@@ -410,23 +410,23 @@ irqreturn_t bfin_can_interrupt(int irq, void *dev_id)
struct net_device_stats *stats = &dev->stats;
u16 status, isrc;
- if ((irq == priv->tx_irq) && bfin_read16(®->mbtif2)) {
+ if ((irq == priv->tx_irq) && bfin_read(®->mbtif2)) {
/* transmission complete interrupt */
- bfin_write16(®->mbtif2, 0xFFFF);
+ bfin_write(®->mbtif2, 0xFFFF);
stats->tx_packets++;
- stats->tx_bytes += bfin_read16(®->chl[TRANSMIT_CHL].dlc);
+ stats->tx_bytes += bfin_read(®->chl[TRANSMIT_CHL].dlc);
can_get_echo_skb(dev, 0);
netif_wake_queue(dev);
- } else if ((irq == priv->rx_irq) && bfin_read16(®->mbrif1)) {
+ } else if ((irq == priv->rx_irq) && bfin_read(®->mbrif1)) {
/* receive interrupt */
- isrc = bfin_read16(®->mbrif1);
- bfin_write16(®->mbrif1, 0xFFFF);
+ isrc = bfin_read(®->mbrif1);
+ bfin_write(®->mbrif1, 0xFFFF);
bfin_can_rx(dev, isrc);
- } else if ((irq == priv->err_irq) && bfin_read16(®->gis)) {
+ } else if ((irq == priv->err_irq) && bfin_read(®->gis)) {
/* error interrupt */
- isrc = bfin_read16(®->gis);
- status = bfin_read16(®->esr);
- bfin_write16(®->gis, 0x7FF);
+ isrc = bfin_read(®->gis);
+ status = bfin_read(®->esr);
+ bfin_write(®->gis, 0x7FF);
bfin_can_err(dev, isrc, status);
} else {
return IRQ_NONE;
@@ -631,9 +631,9 @@ static int bfin_can_suspend(struct platform_device *pdev, pm_message_t mesg)
if (netif_running(dev)) {
/* enter sleep mode */
- bfin_write16(®->control, bfin_read16(®->control) | SMR);
+ bfin_write(®->control, bfin_read(®->control) | SMR);
SSYNC();
- while (!(bfin_read16(®->intr) & SMACK)) {
+ while (!(bfin_read(®->intr) & SMACK)) {
udelay(10);
if (--timeout == 0) {
dev_err(dev->dev.parent,
@@ -654,7 +654,7 @@ static int bfin_can_resume(struct platform_device *pdev)
if (netif_running(dev)) {
/* leave sleep mode */
- bfin_write16(®->intr, 0);
+ bfin_write(®->intr, 0);
SSYNC();
}
--
1.7.5.3
^ permalink raw reply related
* Re: linux-next: Tree for June 23 (net/can & i/o)
From: Mike Frysinger @ 2011-06-23 20:38 UTC (permalink / raw)
To: netdev, socketcan-core; +Cc: linux-next, LKML
On Thu, Jun 23, 2011 at 01:54, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> My fixes tree includes (as an experiment) the early part of
> mmotm-2011-06-22-13-05.
>
> The powerpc allyesconfig (and probably others) is still broken because we
> now build the staging drivers and because of a commit in the net tree.
> The breakage in Linus' tree is fixed by one of Andrew's patches above.
>
> The m68knommu tree lost its conflicts.
>
> The galak tree lost its conflicts.
>
> The net tree gained 2 build failures that I have left (see above).
not sure where this is coming from, but some Blackfin boards now fail with:
drivers/net/can/bfin_can.c: In function 'bfin_can_start_xmit':
drivers/net/can/bfin_can.c:247: error: implicit declaration of function 'writew'
make[3]: *** [drivers/net/can/bfin_can.o] Error 1
at any rate, the usage of writew() in this driver is wrong, so i sent
a patch to fix it. but since nothing in this file nor in my Blackfin
tree changed, i wonder if whatever common code changed is going to
break other stuff ...
-mike
^ permalink raw reply
* Re: [RFT PATCH 7/9] ethtool: prepare for larger netdev_features_t type
From: Mahesh Bandewar @ 2011-06-23 20:38 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Michał Mirosław, netdev, David S. Miller
In-Reply-To: <1308855335.2712.15.camel@bwh-desktop>
On Thu, Jun 23, 2011 at 11:55 AM, Ben Hutchings
<bhutchings@solarflare.com> wrote:
> On Thu, 2011-06-23 at 11:21 -0700, Mahesh Bandewar wrote:
>> On Thu, Jun 23, 2011 at 11:03 AM, Ben Hutchings
>> <bhutchings@solarflare.com> wrote:
>> > On Thu, 2011-06-23 at 10:50 -0700, Mahesh Bandewar wrote:
>> >> On Mon, Jun 20, 2011 at 2:16 PM, Ben Hutchings
>> >> <bhutchings@solarflare.com> wrote:
>> >> >
>> >> > On Mon, 2011-06-20 at 21:14 +0200, Michał Mirosław wrote:
>> >> > [...]
>> >> > > @@ -125,19 +131,26 @@ static int ethtool_set_features(struct net_device *dev, void __user *useraddr)
>> >> > > if (copy_from_user(features, useraddr, sizeof(features)))
>> >> > > return -EFAULT;
>> >> > >
>> >> > > - if (features[0].valid & ~NETIF_F_ETHTOOL_BITS)
>> >> > > + /* I wonder if the compiler will be smart enough to loop-unroll
>> >> > > + * and optimize this... (no worries if not) --mq */
>> >> > > + for (i = ETHTOOL_DEV_FEATURE_WORDS; i-- > 0; ) {
>> >> > > + valid = (valid << 32)|features[i].valid;
>> >> > > + wanted = (wanted << 32)|features[i].requested;
>> >> > > + }
>> >> > [...]
>> >> >
>> >> > I don't know (or care) about optimisation of this, but I would expect
>> >> > gcc to complain about shifting a 32-bit value by 32 bits. I suggest you
>> >> > write this as:
>> >> >
>> >> > for (i = 0; i < ETHTOOL_DEV_FEATURE_WORDS; ++i) {
>> >> > valid |= (netdev_features_t)features[i].valid << 32 *i;
>> >> > wanted |= (netdev_features_t)features[i].requested << 32 *i;
>> >>
>> >> It's a valid point but this type of typecast or similar usage would
>> >> imply that netdev_feature_t is an int of XXX bits. That's not opaque
>> >> and would hinder the way you can abstract the feature type.
>> >
>> > Yes, ethtool_{get,set}_features() will have to be changed if and when
>> > the representation of netdev_features_t is changed significantly. I
>> > don't think there's any way of avoiding that and I don't think it really
>> > matters.
>> >
>> Well, if you have a conversion routine that converts (whatever the)
>> netdev_type_t type is to the ethtool representation (array of u32 for
>> example). So the changes would have to be done in that conversion
>> routine only and not get/set_features() ethtool methods as such.
>
> These are precisely those conversion routines, because there is no other
> place that needs to deal with the ethtool representation...
>
Oh, I was considering get/set_features ethtool methods as APIs to
manipulate certain bits from user-space into kernel space. I was
disassociating features bit representation as a separate aspect and
(of course) the conversion. So depending on the type selection you may
or may not need these conversion routines.
--mahesh..
> Ben.
>
> --
> Ben Hutchings, Senior Software Engineer, Solarflare
> Not speaking for my employer; that's the marketing department's job.
> They asked us to note that Solarflare product names are trademarked.
>
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox