* [PATCH net-next 1/4] openvswitch: Set inner-most protocol for MPLS.
From: Pravin B Shelar @ 2014-12-01 22:30 UTC (permalink / raw)
To: davem; +Cc: netdev, Pravin B Shelar
MPLS GSO needs to know inner most protocol to process GSO packets.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
---
net/openvswitch/actions.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index 764fdc3..770064c 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -147,7 +147,8 @@ static int push_mpls(struct sk_buff *skb, struct sw_flow_key *key,
hdr = eth_hdr(skb);
hdr->h_proto = mpls->mpls_ethertype;
- skb_set_inner_protocol(skb, skb->protocol);
+ if (!skb->inner_protocol)
+ skb_set_inner_protocol(skb, skb->protocol);
skb->protocol = mpls->mpls_ethertype;
invalidate_flow_key(key);
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 0/4] openvswitch: MPLS related fixes.
From: Pravin B Shelar @ 2014-12-01 22:30 UTC (permalink / raw)
To: davem; +Cc: netdev, Pravin B Shelar
First three patches fixes and improves OVS MPLS support. Last
patch is general code cleanup.
Pravin B Shelar (4):
openvswitch: Set inner-most protocol for MPLS.
vlan: Fix mac_len adjustment.
mpls: Fix allowed protocols for mpls gso
openvswitch: Fix coding style.
net/core/skbuff.c | 2 +-
net/mpls/mpls_gso.c | 5 +----
net/openvswitch/actions.c | 6 +++---
net/openvswitch/datapath.c | 11 ++++++-----
net/openvswitch/flow.c | 11 ++++++-----
net/openvswitch/flow_netlink.c | 12 +++++++-----
net/openvswitch/flow_table.c | 3 ++-
7 files changed, 26 insertions(+), 24 deletions(-)
^ permalink raw reply
* [PATCH v2 net-next] net: bcmgenet: enable driver to work without a device tree
From: Petri Gynther @ 2014-12-01 22:08 UTC (permalink / raw)
To: netdev; +Cc: davem, f.fainelli
Broadcom 7xxx MIPS-based STB platforms do not use device trees.
Modify bcmgenet driver so that it can be used on those platforms.
Signed-off-by: Petri Gynther <pgynther@google.com>
---
drivers/net/ethernet/broadcom/Kconfig | 1 -
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 31 ++++--
drivers/net/ethernet/broadcom/genet/bcmmii.c | 134 +++++++++++++++++++++----
include/linux/platform_data/bcmgenet.h | 18 ++++
4 files changed, 152 insertions(+), 32 deletions(-)
create mode 100644 include/linux/platform_data/bcmgenet.h
diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig
index c3e260c..888247a 100644
--- a/drivers/net/ethernet/broadcom/Kconfig
+++ b/drivers/net/ethernet/broadcom/Kconfig
@@ -62,7 +62,6 @@ config BCM63XX_ENET
config BCMGENET
tristate "Broadcom GENET internal MAC support"
- depends on OF
select MII
select PHYLIB
select FIXED_PHY if BCMGENET=y
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index f2fadb0..861c298 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -42,6 +42,7 @@
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/phy.h>
+#include <linux/platform_data/bcmgenet.h>
#include <asm/unaligned.h>
@@ -2586,6 +2587,7 @@ static const struct of_device_id bcmgenet_match[] = {
static int bcmgenet_probe(struct platform_device *pdev)
{
+ struct bcmgenet_platform_data *pd = pdev->dev.platform_data;
struct device_node *dn = pdev->dev.of_node;
const struct of_device_id *of_id;
struct bcmgenet_priv *priv;
@@ -2601,9 +2603,13 @@ static int bcmgenet_probe(struct platform_device *pdev)
return -ENOMEM;
}
- of_id = of_match_node(bcmgenet_match, dn);
- if (!of_id)
- return -EINVAL;
+ if (dn) {
+ of_id = of_match_node(bcmgenet_match, dn);
+ if (!of_id)
+ return -EINVAL;
+ } else {
+ of_id = NULL;
+ }
priv = netdev_priv(dev);
priv->irq0 = platform_get_irq(pdev, 0);
@@ -2615,11 +2621,15 @@ static int bcmgenet_probe(struct platform_device *pdev)
goto err;
}
- macaddr = of_get_mac_address(dn);
- if (!macaddr) {
- dev_err(&pdev->dev, "can't find MAC address\n");
- err = -EINVAL;
- goto err;
+ if (dn) {
+ macaddr = of_get_mac_address(dn);
+ if (!macaddr) {
+ dev_err(&pdev->dev, "can't find MAC address\n");
+ err = -EINVAL;
+ goto err;
+ }
+ } else {
+ macaddr = pd->macaddr;
}
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -2659,7 +2669,10 @@ static int bcmgenet_probe(struct platform_device *pdev)
priv->dev = dev;
priv->pdev = pdev;
- priv->version = (enum bcmgenet_version)of_id->data;
+ if (of_id)
+ priv->version = (enum bcmgenet_version)of_id->data;
+ else
+ priv->version = pd->genet_version;
priv->clk = devm_clk_get(&priv->pdev->dev, "enet");
if (IS_ERR(priv->clk))
diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index 933cd7e..f758686 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -23,6 +23,7 @@
#include <linux/of.h>
#include <linux/of_net.h>
#include <linux/of_mdio.h>
+#include <linux/platform_data/bcmgenet.h>
#include "bcmgenet.h"
@@ -312,22 +313,6 @@ static int bcmgenet_mii_probe(struct net_device *dev)
u32 phy_flags;
int ret;
- if (priv->phydev) {
- pr_info("PHY already attached\n");
- return 0;
- }
-
- /* In the case of a fixed PHY, the DT node associated
- * to the PHY is the Ethernet MAC DT node.
- */
- if (!priv->phy_dn && of_phy_is_fixed_link(dn)) {
- ret = of_phy_register_fixed_link(dn);
- if (ret)
- return ret;
-
- priv->phy_dn = of_node_get(dn);
- }
-
/* Communicate the integrated PHY revision */
phy_flags = priv->gphy_rev;
@@ -337,11 +322,39 @@ static int bcmgenet_mii_probe(struct net_device *dev)
priv->old_duplex = -1;
priv->old_pause = -1;
- phydev = of_phy_connect(dev, priv->phy_dn, bcmgenet_mii_setup,
- phy_flags, priv->phy_interface);
- if (!phydev) {
- pr_err("could not attach to PHY\n");
- return -ENODEV;
+ if (dn) {
+ if (priv->phydev) {
+ pr_info("PHY already attached\n");
+ return 0;
+ }
+
+ /* In the case of a fixed PHY, the DT node associated
+ * to the PHY is the Ethernet MAC DT node.
+ */
+ if (!priv->phy_dn && of_phy_is_fixed_link(dn)) {
+ ret = of_phy_register_fixed_link(dn);
+ if (ret)
+ return ret;
+
+ priv->phy_dn = of_node_get(dn);
+ }
+
+ phydev = of_phy_connect(dev, priv->phy_dn, bcmgenet_mii_setup,
+ phy_flags, priv->phy_interface);
+ if (!phydev) {
+ pr_err("could not attach to PHY\n");
+ return -ENODEV;
+ }
+ } else {
+ phydev = priv->phydev;
+ phydev->dev_flags = phy_flags;
+
+ ret = phy_connect_direct(dev, phydev, bcmgenet_mii_setup,
+ priv->phy_interface);
+ if (ret) {
+ pr_err("could not attach to PHY\n");
+ return -ENODEV;
+ }
}
priv->phydev = phydev;
@@ -438,6 +451,83 @@ static int bcmgenet_mii_of_init(struct bcmgenet_priv *priv)
return 0;
}
+static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv)
+{
+ struct device *kdev = &priv->pdev->dev;
+ struct bcmgenet_platform_data *pd = kdev->platform_data;
+ struct mii_bus *mdio = priv->mii_bus;
+ struct phy_device *phydev;
+ int ret;
+ int i;
+
+ if (pd->phy_type != PHY_INTERFACE_MODE_MOCA && pd->mdio_enabled) {
+ /*
+ * Internal or external PHY with MDIO access
+ */
+ if (pd->phy_addr >= 0 && pd->phy_addr < PHY_MAX_ADDR)
+ mdio->phy_mask = ~(1 << pd->phy_addr);
+ else
+ mdio->phy_mask = 0;
+
+ ret = mdiobus_register(mdio);
+ if (ret) {
+ dev_err(kdev, "failed to register MDIO bus\n");
+ return ret;
+ }
+
+ if (pd->phy_addr >= 0 && pd->phy_addr < PHY_MAX_ADDR) {
+ phydev = mdio->phy_map[pd->phy_addr];
+ } else {
+ phydev = NULL;
+ for (i = 0; i < PHY_MAX_ADDR; i++) {
+ if (mdio->phy_map[i]) {
+ phydev = mdio->phy_map[i];
+ break;
+ }
+ }
+ }
+
+ if (!phydev) {
+ dev_err(kdev, "failed to register PHY device\n");
+ mdiobus_unregister(mdio);
+ return -ENODEV;
+ }
+ } else {
+ /*
+ * MoCA port or no MDIO access.
+ * Use 1000/FD fixed PHY to represent the link layer.
+ */
+ struct fixed_phy_status fphy_status = {
+ .link = 1,
+ .duplex = DUPLEX_FULL,
+ .speed = SPEED_1000,
+ .pause = 0,
+ .asym_pause = 0,
+ };
+
+ phydev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
+ if (!phydev || IS_ERR(phydev)) {
+ dev_err(kdev, "failed to register fixed PHY device\n");
+ return -ENODEV;
+ }
+ }
+
+ priv->phydev = phydev;
+ priv->phy_interface = pd->phy_type;
+
+ return 0;
+}
+
+static int bcmgenet_mii_bus_init(struct bcmgenet_priv *priv)
+{
+ struct device_node *dn = priv->pdev->dev.of_node;
+
+ if (dn)
+ return bcmgenet_mii_of_init(priv);
+ else
+ return bcmgenet_mii_pd_init(priv);
+}
+
int bcmgenet_mii_init(struct net_device *dev)
{
struct bcmgenet_priv *priv = netdev_priv(dev);
@@ -447,7 +537,7 @@ int bcmgenet_mii_init(struct net_device *dev)
if (ret)
return ret;
- ret = bcmgenet_mii_of_init(priv);
+ ret = bcmgenet_mii_bus_init(priv);
if (ret)
goto out_free;
diff --git a/include/linux/platform_data/bcmgenet.h b/include/linux/platform_data/bcmgenet.h
new file mode 100644
index 0000000..3660133
--- /dev/null
+++ b/include/linux/platform_data/bcmgenet.h
@@ -0,0 +1,18 @@
+#ifndef __LINUX_PLATFORM_DATA_BCMGENET_H__
+#define __LINUX_PLATFORM_DATA_BCMGENET_H__
+
+#include <linux/compiler.h>
+#include <linux/if_ether.h>
+
+struct bcmgenet_platform_data {
+ void __iomem *base_reg;
+ int irq0;
+ int irq1;
+ bool mdio_enabled;
+ int phy_type;
+ int phy_addr;
+ u8 macaddr[ETH_ALEN];
+ int genet_version;
+};
+
+#endif
--
2.2.0.rc0.207.ga3a616c
^ permalink raw reply related
* Re: BCM4313 & brcmsmac & 3.12: only semi-working?
From: Maximilian Engelhardt @ 2014-12-01 22:06 UTC (permalink / raw)
To: Arend van Spriel
Cc: Michael Tokarev, Rafał Miłecki, Seth Forshee,
brcm80211 development, linux-wireless@vger.kernel.org,
Network Development
In-Reply-To: <5475A2DC.80502@msgid.tls.msk.ru>
[-- Attachment #1: Type: text/plain, Size: 10527 bytes --]
Hi Arend,
sorry for my late reply, it took me a bit to get the modules compiled with
your patches. Here is the information from my card. During this test I had
very bad performance with my wifi connection with big latency and lots of
packet loss.
[ 1642.407735] bcma: bus0: Found chip with id 0x4313, rev 0x01 and package 0x08
[ 1642.407766] bcma: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x24, class 0x0)
[ 1642.407794] bcma: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x18, class 0x0)
[ 1642.407829] bcma: bus0: Core 2 found: PCIe (manuf 0x4BF, id 0x820, rev 0x11, class 0x0)
[ 1642.407913] bcma: bus0: Found rev 8 PMU (capabilities 0x084C3008)
[ 1642.407978] bcma: bus0: SPROM offset 0x830
[ 1642.410625] bcma: bcmasprom:
[ 1642.410630] bcma:
[ 1642.410635] bcma: 2801
[ 1642.410637] bcma: 0000
[ 1642.410640] bcma: 0608
[ 1642.410642] bcma: 14E4
[ 1642.410645] bcma: 0070
[ 1642.410647] bcma: EDBE
[ 1642.410649] bcma: 0000
[ 1642.410651] bcma: 2BC4
[ 1642.410654] bcma: 2A64
[ 1642.410655] bcma: 2964
[ 1642.410658] bcma:
[ 1642.410659] bcma: 2C64
[ 1642.410662] bcma: 3CE7
[ 1642.410663] bcma: 46FF
[ 1642.410666] bcma: 47FF
[ 1642.410667] bcma: 0C00
[ 1642.410670] bcma: 0820
[ 1642.410671] bcma: 0030
[ 1642.410674] bcma: 1002
[ 1642.410676] bcma: 9F28
[ 1642.410678] bcma: 5D44
[ 1642.410679] bcma:
[ 1642.410683] bcma: 8080
[ 1642.410684] bcma: 1D8F
[ 1642.410687] bcma: 0032
[ 1642.410689] bcma: 0100
[ 1642.410691] bcma: DF00
[ 1642.410693] bcma: 71F5
[ 1642.410695] bcma: 8400
[ 1642.410697] bcma: 0083
[ 1642.410699] bcma: 8500
[ 1642.410701] bcma: 2010
[ 1642.410703] bcma:
[ 1642.410705] bcma: 0001
[ 1642.410707] bcma: 0000
[ 1642.410709] bcma: 0000
[ 1642.410711] bcma: 0000
[ 1642.410713] bcma: 0000
[ 1642.410715] bcma: 0000
[ 1642.410717] bcma: 0000
[ 1642.410719] bcma: 0000
[ 1642.410721] bcma: 0000
[ 1642.410723] bcma: 0000
[ 1642.410724] bcma:
[ 1642.410728] bcma: 0000
[ 1642.410730] bcma: 0000
[ 1642.410732] bcma: 1008
[ 1642.410734] bcma: 0305
[ 1642.410736] bcma: 0000
[ 1642.410738] bcma: 0000
[ 1642.410740] bcma: 0000
[ 1642.410742] bcma: 0000
[ 1642.410744] bcma: 4727
[ 1642.410746] bcma: 8000
[ 1642.410748] bcma:
[ 1642.410749] bcma: 0002
[ 1642.410752] bcma: 0000
[ 1642.410753] bcma: 1F30
[ 1642.410756] bcma: 1800
[ 1642.410757] bcma: 0000
[ 1642.410760] bcma: 0000
[ 1642.410761] bcma: 0000
[ 1642.410764] bcma: 0000
[ 1642.410765] bcma: 0000
[ 1642.410768] bcma: 0000
[ 1642.410769] bcma:
[ 1642.410773] bcma: 0000
[ 1642.410774] bcma: 0000
[ 1642.410777] bcma: 0000
[ 1642.410778] bcma: 0000
[ 1642.410781] bcma: 5372
[ 1642.410782] bcma: 1109
[ 1642.410785] bcma: 2201
[ 1642.410786] bcma: 0040
[ 1642.410789] bcma: 0884
[ 1642.410790] bcma: 0000
[ 1642.410793] bcma:
[ 1642.410794] bcma: C014
[ 1642.410797] bcma: 3DC1
[ 1642.410798] bcma: 809D
[ 1642.410801] bcma: 5856
[ 1642.410802] bcma: 0001
[ 1642.410805] bcma: FFFF
[ 1642.410807] bcma: 83FF
[ 1642.410809] bcma: FFFF
[ 1642.410811] bcma: 0003
[ 1642.410813] bcma: 0202
[ 1642.410814] bcma:
[ 1642.410818] bcma: FFFF
[ 1642.410819] bcma: 0011
[ 1642.410822] bcma: 017A
[ 1642.410824] bcma: 0000
[ 1642.410826] bcma: 0000
[ 1642.410828] bcma: 0000
[ 1642.410830] bcma: 0000
[ 1642.410832] bcma: 0201
[ 1642.410834] bcma: 0000
[ 1642.410836] bcma: 7800
[ 1642.410838] bcma:
[ 1642.410839] bcma: 01FF
[ 1642.410842] bcma: E398
[ 1642.410844] bcma: 0008
[ 1642.410846] bcma: 0000
[ 1642.410848] bcma: 0000
[ 1642.410850] bcma: 0000
[ 1642.410852] bcma: 0044
[ 1642.410854] bcma: 2400
[ 1642.410856] bcma: FCF7
[ 1642.410858] bcma: 0089
[ 1642.410860] bcma:
[ 1642.410863] bcma: 0000
[ 1642.410865] bcma: 0000
[ 1642.410867] bcma: 0000
[ 1642.410869] bcma: 0000
[ 1642.410871] bcma: 0000
[ 1642.410873] bcma: 0000
[ 1642.410875] bcma: 0000
[ 1642.410877] bcma: 0000
[ 1642.410879] bcma: 0000
[ 1642.410881] bcma: 0000
[ 1642.410883] bcma:
[ 1642.410884] bcma: 0000
[ 1642.410887] bcma: 0000
[ 1642.410888] bcma: 0048
[ 1642.410891] bcma: FED2
[ 1642.410892] bcma: 15D9
[ 1642.410895] bcma: FAC6
[ 1642.410897] bcma: 0000
[ 1642.410899] bcma: 0000
[ 1642.410901] bcma: 0000
[ 1642.410903] bcma: 0000
[ 1642.410904] bcma:
[ 1642.410908] bcma: 0000
[ 1642.410909] bcma: 0000
[ 1642.410912] bcma: 0000
[ 1642.410913] bcma: 0000
[ 1642.410916] bcma: 0000
[ 1642.410917] bcma: 0000
[ 1642.410920] bcma: 0000
[ 1642.410921] bcma: 0000
[ 1642.410924] bcma: 0000
[ 1642.410925] bcma: 0000
[ 1642.410927] bcma:
[ 1642.410929] bcma: 0000
[ 1642.410931] bcma: 0000
[ 1642.410933] bcma: 0000
[ 1642.410935] bcma: 0000
[ 1642.410937] bcma: 0000
[ 1642.410939] bcma: 0000
[ 1642.410941] bcma: 0000
[ 1642.410943] bcma: 0000
[ 1642.410945] bcma: 0000
[ 1642.410947] bcma: 0000
[ 1642.410949] bcma:
[ 1642.410952] bcma: 0000
[ 1642.410954] bcma: 0000
[ 1642.410956] bcma: 0000
[ 1642.410958] bcma: 0000
[ 1642.410960] bcma: 0000
[ 1642.410962] bcma: 0000
[ 1642.410964] bcma: 0000
[ 1642.410966] bcma: 0000
[ 1642.410968] bcma: 0000
[ 1642.410970] bcma: 0000
[ 1642.410972] bcma:
[ 1642.410974] bcma: 0000
[ 1642.410976] bcma: 0000
[ 1642.410978] bcma: 0000
[ 1642.410980] bcma: 0000
[ 1642.410982] bcma: 0000
[ 1642.410984] bcma: 0000
[ 1642.410986] bcma: 0000
[ 1642.410988] bcma: 0000
[ 1642.410990] bcma: 0000
[ 1642.410992] bcma: 0000
[ 1642.410994] bcma:
[ 1642.410997] bcma: 0000
[ 1642.410999] bcma: 1111
[ 1642.411001] bcma: 1111
[ 1642.411003] bcma: 0000
[ 1642.411005] bcma: 0000
[ 1642.411007] bcma: 0000
[ 1642.411009] bcma: 0000
[ 1642.411010] bcma: 0000
[ 1642.411013] bcma: 0000
[ 1642.411015] bcma: 2222
[ 1642.411017] bcma:
[ 1642.411018] bcma: 3222
[ 1642.411021] bcma: 0000
[ 1642.411022] bcma: 0000
[ 1642.411025] bcma: 0000
[ 1642.411026] bcma: 0000
[ 1642.411029] bcma: 0000
[ 1642.411030] bcma: 0000
[ 1642.411033] bcma: 0000
[ 1642.411034] bcma: 0000
[ 1642.411037] bcma: 0000
[ 1642.411038] bcma:
[ 1642.411041] bcma: 0000
[ 1642.411043] bcma: 0000
[ 1642.411045] bcma: 0000
[ 1642.411047] bcma: 0000
[ 1642.411050] bcma: 0000
[ 1642.411051] bcma: 0000
[ 1642.411054] bcma: 0000
[ 1642.411055] bcma: 0000
[ 1642.411058] bcma: 0000
[ 1642.411059] bcma: 0000
[ 1642.411061] bcma:
[ 1642.411063] bcma: 0000
[ 1642.411065] bcma: 0000
[ 1642.411067] bcma: 0000
[ 1642.411069] bcma: 0000
[ 1642.411071] bcma: 0000
[ 1642.411073] bcma: 0000
[ 1642.411075] bcma: 0000
[ 1642.411077] bcma: 0000
[ 1642.411079] bcma: 0000
[ 1642.411081] bcma: 0000
[ 1642.411083] bcma:
[ 1642.411086] bcma: 0000
[ 1642.411088] bcma: 0000
[ 1642.411090] bcma: 0000
[ 1642.411092] bcma: 0000
[ 1642.411094] bcma: 0000
[ 1642.411096] bcma: 0000
[ 1642.411098] bcma: 0000
[ 1642.411100] bcma: 0000
[ 1642.411102] bcma: 0000
[ 1642.411104] bcma: 0000
[ 1642.411106] bcma:
[ 1642.411107] bcma: 0000
[ 1642.411110] bcma: 0000
[ 1642.411111] bcma: 0000
[ 1642.411114] bcma: 0000
[ 1642.411115] bcma: 0000
[ 1642.411118] bcma: 0000
[ 1642.411119] bcma: 0000
[ 1642.411122] bcma: 0000
[ 1642.411123] bcma: 0000
[ 1642.411127] bcma: bus0: Found SPROM revision 8
[ 1642.434510] bcma: bus0: GPIO driver not activated
[ 1642.434518] bcma: bus0: Bus registered
[ 1642.449971] brcmsmac bcma0:0: mfg 4bf core 812 rev 24 class 0 irq 17
[ 1642.450095] bcma: bus0: Switched to core: 0x812
[ 1642.451446] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
[ 4112.897927] brcmsmac bcma0:0: brcms_ops_bss_info_changed: qos enabled: false (implement)
[ 4112.898113] brcmsmac bcma0:0: brcms_ops_config: change power-save mode: false (implement)
[ 4112.899832] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 4113.830658] wlan0: authenticate with e8:de:27:44:3b:33
[ 4113.830764] wlan0: send auth to e8:de:27:44:3b:33 (try 1/3)
[ 4113.832620] wlan0: authenticated
[ 4113.833859] wlan0: associate with e8:de:27:44:3b:33 (try 1/3)
[ 4113.837231] wlan0: RX AssocResp from e8:de:27:44:3b:33 (capab=0x431 status=0 aid=1)
[ 4113.837591] brcmsmac bcma0:0: brcmsmac: brcms_ops_bss_info_changed: associated
[ 4113.837752] brcmsmac bcma0:0: brcms_ops_bss_info_changed: arp filtering: 1 addresses (implement)
[ 4113.837861] brcmsmac bcma0:0: brcms_ops_bss_info_changed: qos enabled: true (implement)
[ 4113.838209] wlan0: associated
[ 4113.838228] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 4113.838771] cfg80211: Calling CRDA for country: DE
[ 4113.847285] cfg80211: Regulatory domain changed to country: DE
[ 4113.847298] cfg80211: DFS Master region: ETSI
[ 4113.847302] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 4113.847308] cfg80211: (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 4113.847313] cfg80211: (5150000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 4113.847318] cfg80211: (5250000 KHz - 5350000 KHz @ 80000 KHz), (N/A, 2000 mBm), (0 s)
[ 4113.847322] cfg80211: (5470000 KHz - 5725000 KHz @ 80000 KHz), (N/A, 2698 mBm), (0 s)
[ 4113.847327] cfg80211: (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
$ cat brcmsmac/bcma0\:0/hardware
chipnum 0x4313
chiprev 0x1
chippackage 0x8
corerev 0x18
boardid 0x608
boardvendor 0x14e4
boardrev P109
boardflags 0x402201
boardflags2 0x884
ucoderev 0x262032c
radiorev 0x1
phytype 0x8
phyrev 0x1
anarev 0xa
nvramrev 8
$ cat brcmsmac/bcma0\:0/macstat
txallfrm: 1622
txrtsfrm: 739
txctsfrm: 269
txackfrm: 128
txdnlfrm: 0
txbcnfrm: 0
txfunfl[8]: 0 0 0 0 0 0 0 0
txtplunfl: 0
txphyerr: 0
pktengrxducast: 0
pktengrxdmcast: 0
rxfrmtoolong: 927
rxfrmtooshrt: 158
rxinvmachdr: 3145
rxbadfcs: 7459
rxbadplcp: 28631
rxcrsglitch: 945
rxstrt: 17138
rxdfrmucastmbss: 112
rxmfrmucastmbss: 16
rxcfrmucast: 745
rxrtsucast: 269
rxctsucast: 311
rxackucast: 38
rxdfrmocast: 21
rxmfrmocast: 16
rxcfrmocast: 7664
rxrtsocast: 379
rxctsocast: 6351
rxdfrmmcast: 5
rxmfrmmcast: 141
rxcfrmmcast: 0
rxbeaconmbss: 47
rxdfrmucastobss: 0
rxbeaconobss: 55
rxrsptmout: 650
bcntxcancl: 0
rxf0ovfl: 0
rxf1ovfl: 0
rxf2ovfl: 0
txsfovfl: 0
pmqovfl: 0
rxcgprqfrm: 0
rxcgprsqovfl: 0
txcgprsfail: 0
txcgprssuc: 0
prs_timeout: 0
rxnack: 0
frmscons: 0
txnack: 0
txglitch_nack: 127
txburst: 0
bphy_rxcrsglitch: 1
phywatchdog: 0
bphy_badplcp: 0
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: Is this 32-bit NCM?
From: Eli Britstein @ 2014-12-01 22:02 UTC (permalink / raw)
To: Enrico Mioso
Cc: Kevin Zhu, Bjørn Mork, Alex Strizhevsky, Midge Shaojun Tan,
youtux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <alpine.LNX.2.03.1412012202480.1301-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Hi Enrico and all,
Maybe I missed something but what is the difference by the driver point of view between the dhcp discover and request (that are ok) to others (like arp, that is nok)?
Maybe we can trace to compare them?
Sent from my iPhone
> On 1 בדצמ 2014, at 23:11, "Enrico Mioso" <mrkiko.rs@gmail.com> wrote:
>
> So ... I have two ideas left for now.
> We know for sure the problem is in the way we TX frames, not the way we RX them
> (the way we send, generate them, not the way we receive them).
> Si I have two ideas, and I ask for help from the Linux-usb mailing list for
> this first one.
>
> 1 - Does a wayexist to "replay" traffic crom a usb capture?
> We might try to take the usb frames generated by Windows, and send them to the
> device to see if there is any reaction. It should not be science fiction, I saw
> them do that in the eciadsl old project.
> 2 - The huawei ndis driver: does it work with these devices?
> It should be a little bit out-dated now (at least in terms of dates, it might
> work as well): the code is A LOT but, just in case, to see if there is any
> chances it'll work. It remains to be seen in which kernels it can actually
> compile again.
>
> If this works we might analyse what's happening and try to debug this out.
> But I really would like this to work in the cdc_ncm driver + huawei_cdc_ncm.
> Thank you.
________________________________
This email and any files transmitted with it are confidential material. They are intended solely for the use of the designated individual or entity to whom they are addressed. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, use, distribution or copying of this communication is strictly prohibited and may be unlawful.
If you have received this email in error please immediately notify the sender and delete or destroy any copy of this message
^ permalink raw reply
* [PATCH net-next] hyperv: Add support for vNIC hot removal
From: Haiyang Zhang @ 2014-12-01 21:28 UTC (permalink / raw)
To: davem, netdev; +Cc: olaf, jasowang, driverdev-devel, linux-kernel, haiyangz
This patch adds proper handling of the vNIC hot removal event, which includes
a rescind-channel-offer message from the host side that triggers vNIC close and
removal. In this case, the notices to the host during close and removal is not
necessary because the channel is rescinded. This patch blocks these unnecessary
messages, and lets vNIC removal process complete normally.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/hv/channel_mgmt.c | 2 ++
drivers/net/hyperv/netvsc.c | 3 +++
drivers/net/hyperv/rndis_filter.c | 3 +++
include/linux/hyperv.h | 2 ++
4 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index a2d1a96..191a6a3 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -517,6 +517,8 @@ static void vmbus_onoffer_rescind(struct vmbus_channel_message_header *hdr)
/* Just return here, no channel found */
return;
+ channel->rescind = true;
+
/* work is initialized for vmbus_process_rescind_offer() from
* vmbus_process_offer() where the channel got created */
queue_work(channel->controlwq, &channel->work);
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 6fc834e..dd867e6 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -764,6 +764,9 @@ int netvsc_send(struct hv_device *device,
out_channel = device->channel;
packet->channel = out_channel;
+ if (out_channel->rescind)
+ return -ENODEV;
+
if (packet->page_buf_cnt) {
ret = vmbus_sendpacket_pagebuffer(out_channel,
packet->page_buf,
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index 7b2c5d1..ec0c40a 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -958,6 +958,9 @@ static int rndis_filter_close_device(struct rndis_device *dev)
return 0;
ret = rndis_filter_set_packet_filter(dev, 0);
+ if (ret == -ENODEV)
+ ret = 0;
+
if (ret == 0)
dev->state = RNDIS_DEV_INITIALIZED;
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 08cfaff..476c685 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -650,6 +650,8 @@ struct vmbus_channel {
u8 monitor_grp;
u8 monitor_bit;
+ bool rescind; /* got rescind msg */
+
u32 ringbuffer_gpadlhandle;
/* Allocated memory for ring buffer */
--
1.7.1
^ permalink raw reply related
* Re: [PATCH net-next] net: bcmgenet: enable driver to work without a device tree
From: Florian Fainelli @ 2014-12-01 21:20 UTC (permalink / raw)
To: Petri Gynther; +Cc: netdev, David Miller, Kevin Cernekee
In-Reply-To: <CAGXr9JGgPD_LTCqbdNBgZi+pGboadRX0A3ZbdmAxp3rNBb12ww@mail.gmail.com>
On 01/12/14 13:13, Petri Gynther wrote:
> Hi Florian,
>
> Getting back to this (finally). I have made changes per your comments.
> Sending a new patch shortly.
Ok, I am still a little bit hesitant in accepting these changes
considering that Kevin spent some time making a BMIPS multiplatform
kernel to work on 7425, 7435 [1]. Let's see how your changes look like,
and we can decide by then.
https://lwn.net/Articles/622947/
>
> -- Petri
>
> On Fri, Oct 10, 2014 at 12:46 PM, Petri Gynther <pgynther@google.com> wrote:
>> Hi Florian,
>>
>> On Fri, Oct 10, 2014 at 11:59 AM, Florian Fainelli <f.fainelli@gmail.com> wrote:
>>> On 10/10/2014 11:35 AM, Petri Gynther wrote:
>>>> Broadcom 7xxx MIPS-based STB platforms do not use device trees.
>>>> Modify bcmgenet driver so that it can be used on those platforms.
>>>>
>>>> Signed-off-by: Petri Gynther <pgynther@google.com>
>>>> ---
>>>
>>> [snip]
>>>
>>>> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
>>>> index dbf524e..5191e3f 100644
>>>> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h
>>>> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
>>>> @@ -17,6 +17,17 @@
>>>> #include <linux/if_vlan.h>
>>>> #include <linux/phy.h>
>>>>
>>>> +struct bcmgenet_platform_data {
>>>> + void __iomem *base_reg;
>>>> + int irq0;
>>>> + int irq1;
>>>
>>> Why would these members here? The platform device should provide those
>>> as standard resources that the driver fetches using
>>> platform_get_resource() and platform_get_irq().
>>>
>>
>> I modeled this on struct bcmemac_platform_data that was used in the
>> legacy BRCMSTB code.
>> include/linux/brcmstb/brcmstb.h:
>>
>> struct bcmemac_platform_data {
>> /* used by the BSP code only */
>> uintptr_t base_reg;
>> int irq0;
>> int irq1;
>>
>> int phy_type;
>> int phy_id;
>> int phy_speed;
>> u8 macaddr[ETH_ALEN];
>> };
>>
>> The legacy BRCMSTB code stores all relevant GENET info in this struct
>> and then creates the resources from that info:
>>
>> static void __init brcm_register_genet(int id, struct bcmemac_platform_data *pd)
>> {
>> struct resource res[3];
>> struct platform_device *pdev;
>>
>> memset(&res, 0, sizeof(res));
>> res[0].start = BPHYSADDR(pd->base_reg);
>> res[0].end = BPHYSADDR(pd->base_reg + 0x4fff);
>> res[0].flags = IORESOURCE_MEM;
>>
>> res[1].start = res[1].end = pd->irq0;
>> res[1].flags = IORESOURCE_IRQ;
>>
>> res[2].start = res[2].end = pd->irq1;
>> res[2].flags = IORESOURCE_IRQ;
>>
>> brcm_alloc_macaddr(pd->macaddr);
>>
>> pdev = platform_device_alloc("bcmgenet", id);
>> platform_device_add_resources(pdev, res, 3);
>> platform_device_add_data(pdev, pd, sizeof(*pd));
>> platform_device_add(pdev);
>> }
>>
>>>> + int phy_type;
>>>> + int phy_addr;
>>>> + int phy_speed;
>>>> + u8 macaddr[ETH_ALEN];
>>>> + int genet_version;
>>>> +};
>>>
>>> I would rather we put this in include/linux/platform_data/bcmgenet.h
>>> where it belongs.
>>>
>>
>> I wasn't aware of the directory include/linux/platform_data/. Yes,
>> that's where this belongs.
>>
>>>> +
>>>> /* total number of Buffer Descriptors, same for Rx/Tx */
>>>> #define TOTAL_DESC 256
>>>>
>>>> diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
>>>> index 9ff799a..e5ff913 100644
>>>> --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
>>>> +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
>>>> @@ -157,6 +157,21 @@ static void bcmgenet_mii_setup(struct net_device *dev)
>>>> phy_print_status(phydev);
>>>> }
>>>>
>>>> +static int bcmgenet_moca_fphy_update(struct net_device *dev,
>>>> + struct fixed_phy_status *status)
>>>> +{
>>>> + struct bcmgenet_priv *priv = netdev_priv(dev);
>>>> + struct phy_device *phydev = priv->phydev;
>>>> +
>>>> + /*
>>>> + * MoCA daemon updates phydev->autoneg to reflect the link status.
>>>> + * Update MoCA fixed PHY status accordingly, so that the PHY state
>>>> + * machine becomes aware of the real link status.
>>>> + */
>>>> + status->link = phydev->autoneg;
>>>> + return 0;
>>>> +}
>>>
>>> I don't want to see that in the upstream driver, please enable the link
>>> interrupts like I suggested before and do not use the autoneg field at
>>> all, which should require no MoCA daemon modifications.
>>>
>>
>> I added debug printk's to bcmgenet_isr0 to check on UMAC_IRQ_LINK_UP
>> and UMAC_IRQ_LINK_DOWN.
>> I am not getting those interrupts on eth1 (MoCA) port when coax is
>> removed/inserted.
>> But, they do work on eth0.
>>
>> I'll modify init_umac() to enable those interrupts for MoCA port and retest.
>>
>>> [snip]
>>>
>>>>
>>>> priv->phydev = phydev;
>>>> @@ -437,6 +464,104 @@ static int bcmgenet_mii_of_init(struct bcmgenet_priv *priv)
>>>> return 0;
>>>> }
>>>>
>>>> +static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv)
>>>> +{
>>>> + struct device *kdev = &priv->pdev->dev;
>>>> + struct bcmgenet_platform_data *pd = kdev->platform_data;
>>>> + struct mii_bus *mdio = priv->mii_bus;
>>>> + int phy_addr = pd->phy_addr;
>>>> + struct phy_device *phydev;
>>>> + int ret;
>>>> + int i;
>>>> +
>>>> + /* Disable automatic MDIO bus scan */
>>>> + mdio->phy_mask = ~0;
>>>> +
>>>> + /* Clear all the IRQ properties */
>>>> + if (mdio->irq)
>>>> + for (i = 0; i < PHY_MAX_ADDR; i++)
>>>> + mdio->irq[i] = PHY_POLL;
>>>> +
>>>> + /* Register the MDIO bus */
>>>> + ret = mdiobus_register(mdio);
>>>> + if (ret) {
>>>> + dev_err(kdev, "failed to register MDIO bus\n");
>>>> + return ret;
>>>> + }
>>>> +
>>>> + /*
>>>> + * bcmgenet_platform_data needs to pass a valid PHY address for
>>>> + * internal/external PHY or -1 for MoCA PHY.
>>>> + */
>>>> + if (phy_addr >= 0 && phy_addr < PHY_MAX_ADDR) {
>>>
>>> We do too much low-level PHY device handling, and since you already have
>>> the phy_type provided via platform_data, we can use that hint to do the
>>> following:
>>>
>>> 1) an internal or external PHY with MDIO accesses should leave the bus
>>> auto-probing on with the specified PHY address in the mdio bus phy_mask
>>>
>>> 2) a MoCA PHY or an external PHY with MDIO accesses disabled should use
>>> the fixed-0 MII bus instead.
>>>
>>> This would look like this:
>>>
>>> if (pd->phy_type != PHY_INTERFACE_MODE_MOCA || pd->mdio_enabled)
>>> mdio->phy_mask = ~(1 << pd->phy_addr);
>>>
>>> ...
>>> mdiobus_register()
>>>
>>> priv->phydev = mdio->bus->phy_map[pd->phy_addr];
>>>
>>> phydev->phy_flags |= mask;
>>>
>>> if (pd->phy_type == PHY_INTERFACE_MODE_MOCA || !pd->mdio_enabled)
>>> priv->phydev = fixed_phy_register(...);
>>>
>>> and in both cases, later on you do connect to the PHY device
>>>
>>> I can cook a patch to illustrate what I think this could look like since
>>> I realize using pseudo-code to explain might not be the best thing.
>>>
>>
>> I think I understand what you mean. I'll make a change.
>>
>>>> + /*
>>>> + * 10/100/1000 Ethernet port with external or internal PHY.
>>>> + */
>>>> + phydev = get_phy_device(mdio, phy_addr, false);
>>>> + if (!phydev || IS_ERR(phydev)) {
>>>> + dev_err(kdev, "failed to create PHY device\n");
>>>> + mdiobus_unregister(mdio);
>>>> + return 1;
>>>> + }
>>>> +
>>>> + phydev->irq = PHY_POLL;
>>>> +
>>>> + ret = phy_device_register(phydev);
>>>> + if (ret) {
>>>> + dev_err(kdev, "failed to register PHY device\n");
>>>> + phy_device_free(phydev);
>>>> + mdiobus_unregister(mdio);
>>>> + return 1;
>>>> + }
>>>> +
>>>> + priv->phydev = phydev;
>>>> + priv->phy_interface = pd->phy_type;
>>>> + } else {
>>>> + /*
>>>> + * MoCA port with no MDIO-accessible PHY.
>>>> + * We need to use 1000/HD fixed PHY to represent the link layer.
>>>> + * MoCA daemon interacts with this PHY via ethtool.
>>>> + */
>>>> + struct fixed_phy_status moca_fphy_status = {
>>>> + .link = 0,
>>>> + .duplex = 0,
>>>
>>> This should be DUPLEX_FULL here, the link between GENET and the MoCA
>>> Ethernet convergence layer is full-duplex by nature (despite we report
>>> the PHY being half-duplex, which is a mistake in the downstream driver),
>>> the MoCA medium on the coaxial cable is half-duplex though, but that is
>>> handled by the MoCA HW.
>>>
>>> NB: I had issues in the past using a half-duplex link with the MoCA
>>> ethernet convergence layer, causing various types of packet loss because
>>> we use a simplified signaling internally in the hardware.
>>>
>>
>> I picked this setting from 3.3 GENET driver. I'll test 1000/FULL on my
>> platform to see if it works.
>>
>>>> + .speed = 1000,
>>>> + .pause = 0,
>>>> + .asym_pause = 0,
>>>> + };
>>>> +
>>>> + phydev = fixed_phy_register(PHY_POLL, &moca_fphy_status, NULL);
>>>> + if (!phydev || IS_ERR(phydev)) {
>>>> + dev_err(kdev, "failed to register fixed PHY device\n");
>>>> + mdiobus_unregister(mdio);
>>>> + return 1;
>>>> + }
>>>> +
>>>> + phydev->autoneg = AUTONEG_DISABLE;
>>>> +
>>>> + ret = fixed_phy_set_link_update(phydev,
>>>> + bcmgenet_moca_fphy_update);
>>>> + if (ret) {
>>>> + dev_err(kdev, "failed to set fixed PHY link update\n");
>>>> + }
>>>
>>> Should not we propagate this error to the caller?
>>
>> Good catch. Yes.
>>
>>> --
>>> Florian
^ permalink raw reply
* Re: [PATCH net-next] net: bcmgenet: enable driver to work without a device tree
From: Petri Gynther @ 2014-12-01 21:13 UTC (permalink / raw)
To: Florian Fainelli; +Cc: netdev, David Miller
In-Reply-To: <CAGXr9JH2w1xoUwzzfdC4gi99iu3Eo4zkyWCsZi1b_x_gm+OKqg@mail.gmail.com>
Hi Florian,
Getting back to this (finally). I have made changes per your comments.
Sending a new patch shortly.
-- Petri
On Fri, Oct 10, 2014 at 12:46 PM, Petri Gynther <pgynther@google.com> wrote:
> Hi Florian,
>
> On Fri, Oct 10, 2014 at 11:59 AM, Florian Fainelli <f.fainelli@gmail.com> wrote:
>> On 10/10/2014 11:35 AM, Petri Gynther wrote:
>>> Broadcom 7xxx MIPS-based STB platforms do not use device trees.
>>> Modify bcmgenet driver so that it can be used on those platforms.
>>>
>>> Signed-off-by: Petri Gynther <pgynther@google.com>
>>> ---
>>
>> [snip]
>>
>>> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
>>> index dbf524e..5191e3f 100644
>>> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h
>>> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
>>> @@ -17,6 +17,17 @@
>>> #include <linux/if_vlan.h>
>>> #include <linux/phy.h>
>>>
>>> +struct bcmgenet_platform_data {
>>> + void __iomem *base_reg;
>>> + int irq0;
>>> + int irq1;
>>
>> Why would these members here? The platform device should provide those
>> as standard resources that the driver fetches using
>> platform_get_resource() and platform_get_irq().
>>
>
> I modeled this on struct bcmemac_platform_data that was used in the
> legacy BRCMSTB code.
> include/linux/brcmstb/brcmstb.h:
>
> struct bcmemac_platform_data {
> /* used by the BSP code only */
> uintptr_t base_reg;
> int irq0;
> int irq1;
>
> int phy_type;
> int phy_id;
> int phy_speed;
> u8 macaddr[ETH_ALEN];
> };
>
> The legacy BRCMSTB code stores all relevant GENET info in this struct
> and then creates the resources from that info:
>
> static void __init brcm_register_genet(int id, struct bcmemac_platform_data *pd)
> {
> struct resource res[3];
> struct platform_device *pdev;
>
> memset(&res, 0, sizeof(res));
> res[0].start = BPHYSADDR(pd->base_reg);
> res[0].end = BPHYSADDR(pd->base_reg + 0x4fff);
> res[0].flags = IORESOURCE_MEM;
>
> res[1].start = res[1].end = pd->irq0;
> res[1].flags = IORESOURCE_IRQ;
>
> res[2].start = res[2].end = pd->irq1;
> res[2].flags = IORESOURCE_IRQ;
>
> brcm_alloc_macaddr(pd->macaddr);
>
> pdev = platform_device_alloc("bcmgenet", id);
> platform_device_add_resources(pdev, res, 3);
> platform_device_add_data(pdev, pd, sizeof(*pd));
> platform_device_add(pdev);
> }
>
>>> + int phy_type;
>>> + int phy_addr;
>>> + int phy_speed;
>>> + u8 macaddr[ETH_ALEN];
>>> + int genet_version;
>>> +};
>>
>> I would rather we put this in include/linux/platform_data/bcmgenet.h
>> where it belongs.
>>
>
> I wasn't aware of the directory include/linux/platform_data/. Yes,
> that's where this belongs.
>
>>> +
>>> /* total number of Buffer Descriptors, same for Rx/Tx */
>>> #define TOTAL_DESC 256
>>>
>>> diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
>>> index 9ff799a..e5ff913 100644
>>> --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
>>> +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
>>> @@ -157,6 +157,21 @@ static void bcmgenet_mii_setup(struct net_device *dev)
>>> phy_print_status(phydev);
>>> }
>>>
>>> +static int bcmgenet_moca_fphy_update(struct net_device *dev,
>>> + struct fixed_phy_status *status)
>>> +{
>>> + struct bcmgenet_priv *priv = netdev_priv(dev);
>>> + struct phy_device *phydev = priv->phydev;
>>> +
>>> + /*
>>> + * MoCA daemon updates phydev->autoneg to reflect the link status.
>>> + * Update MoCA fixed PHY status accordingly, so that the PHY state
>>> + * machine becomes aware of the real link status.
>>> + */
>>> + status->link = phydev->autoneg;
>>> + return 0;
>>> +}
>>
>> I don't want to see that in the upstream driver, please enable the link
>> interrupts like I suggested before and do not use the autoneg field at
>> all, which should require no MoCA daemon modifications.
>>
>
> I added debug printk's to bcmgenet_isr0 to check on UMAC_IRQ_LINK_UP
> and UMAC_IRQ_LINK_DOWN.
> I am not getting those interrupts on eth1 (MoCA) port when coax is
> removed/inserted.
> But, they do work on eth0.
>
> I'll modify init_umac() to enable those interrupts for MoCA port and retest.
>
>> [snip]
>>
>>>
>>> priv->phydev = phydev;
>>> @@ -437,6 +464,104 @@ static int bcmgenet_mii_of_init(struct bcmgenet_priv *priv)
>>> return 0;
>>> }
>>>
>>> +static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv)
>>> +{
>>> + struct device *kdev = &priv->pdev->dev;
>>> + struct bcmgenet_platform_data *pd = kdev->platform_data;
>>> + struct mii_bus *mdio = priv->mii_bus;
>>> + int phy_addr = pd->phy_addr;
>>> + struct phy_device *phydev;
>>> + int ret;
>>> + int i;
>>> +
>>> + /* Disable automatic MDIO bus scan */
>>> + mdio->phy_mask = ~0;
>>> +
>>> + /* Clear all the IRQ properties */
>>> + if (mdio->irq)
>>> + for (i = 0; i < PHY_MAX_ADDR; i++)
>>> + mdio->irq[i] = PHY_POLL;
>>> +
>>> + /* Register the MDIO bus */
>>> + ret = mdiobus_register(mdio);
>>> + if (ret) {
>>> + dev_err(kdev, "failed to register MDIO bus\n");
>>> + return ret;
>>> + }
>>> +
>>> + /*
>>> + * bcmgenet_platform_data needs to pass a valid PHY address for
>>> + * internal/external PHY or -1 for MoCA PHY.
>>> + */
>>> + if (phy_addr >= 0 && phy_addr < PHY_MAX_ADDR) {
>>
>> We do too much low-level PHY device handling, and since you already have
>> the phy_type provided via platform_data, we can use that hint to do the
>> following:
>>
>> 1) an internal or external PHY with MDIO accesses should leave the bus
>> auto-probing on with the specified PHY address in the mdio bus phy_mask
>>
>> 2) a MoCA PHY or an external PHY with MDIO accesses disabled should use
>> the fixed-0 MII bus instead.
>>
>> This would look like this:
>>
>> if (pd->phy_type != PHY_INTERFACE_MODE_MOCA || pd->mdio_enabled)
>> mdio->phy_mask = ~(1 << pd->phy_addr);
>>
>> ...
>> mdiobus_register()
>>
>> priv->phydev = mdio->bus->phy_map[pd->phy_addr];
>>
>> phydev->phy_flags |= mask;
>>
>> if (pd->phy_type == PHY_INTERFACE_MODE_MOCA || !pd->mdio_enabled)
>> priv->phydev = fixed_phy_register(...);
>>
>> and in both cases, later on you do connect to the PHY device
>>
>> I can cook a patch to illustrate what I think this could look like since
>> I realize using pseudo-code to explain might not be the best thing.
>>
>
> I think I understand what you mean. I'll make a change.
>
>>> + /*
>>> + * 10/100/1000 Ethernet port with external or internal PHY.
>>> + */
>>> + phydev = get_phy_device(mdio, phy_addr, false);
>>> + if (!phydev || IS_ERR(phydev)) {
>>> + dev_err(kdev, "failed to create PHY device\n");
>>> + mdiobus_unregister(mdio);
>>> + return 1;
>>> + }
>>> +
>>> + phydev->irq = PHY_POLL;
>>> +
>>> + ret = phy_device_register(phydev);
>>> + if (ret) {
>>> + dev_err(kdev, "failed to register PHY device\n");
>>> + phy_device_free(phydev);
>>> + mdiobus_unregister(mdio);
>>> + return 1;
>>> + }
>>> +
>>> + priv->phydev = phydev;
>>> + priv->phy_interface = pd->phy_type;
>>> + } else {
>>> + /*
>>> + * MoCA port with no MDIO-accessible PHY.
>>> + * We need to use 1000/HD fixed PHY to represent the link layer.
>>> + * MoCA daemon interacts with this PHY via ethtool.
>>> + */
>>> + struct fixed_phy_status moca_fphy_status = {
>>> + .link = 0,
>>> + .duplex = 0,
>>
>> This should be DUPLEX_FULL here, the link between GENET and the MoCA
>> Ethernet convergence layer is full-duplex by nature (despite we report
>> the PHY being half-duplex, which is a mistake in the downstream driver),
>> the MoCA medium on the coaxial cable is half-duplex though, but that is
>> handled by the MoCA HW.
>>
>> NB: I had issues in the past using a half-duplex link with the MoCA
>> ethernet convergence layer, causing various types of packet loss because
>> we use a simplified signaling internally in the hardware.
>>
>
> I picked this setting from 3.3 GENET driver. I'll test 1000/FULL on my
> platform to see if it works.
>
>>> + .speed = 1000,
>>> + .pause = 0,
>>> + .asym_pause = 0,
>>> + };
>>> +
>>> + phydev = fixed_phy_register(PHY_POLL, &moca_fphy_status, NULL);
>>> + if (!phydev || IS_ERR(phydev)) {
>>> + dev_err(kdev, "failed to register fixed PHY device\n");
>>> + mdiobus_unregister(mdio);
>>> + return 1;
>>> + }
>>> +
>>> + phydev->autoneg = AUTONEG_DISABLE;
>>> +
>>> + ret = fixed_phy_set_link_update(phydev,
>>> + bcmgenet_moca_fphy_update);
>>> + if (ret) {
>>> + dev_err(kdev, "failed to set fixed PHY link update\n");
>>> + }
>>
>> Should not we propagate this error to the caller?
>
> Good catch. Yes.
>
>> --
>> Florian
^ permalink raw reply
* Re: Is this 32-bit NCM?
From: Enrico Mioso @ 2014-12-01 21:11 UTC (permalink / raw)
To: Mingying.Zhu
Cc: Bjørn Mork, Alex Strizhevsky, ShaojunMidge.Tan, youtux,
linux-usb, netdev, Eli.Britstein
In-Reply-To: <87ppc71xne.fsf@nemi.mork.no>
So ... I have two ideas left for now.
We know for sure the problem is in the way we TX frames, not the way we RX them
(the way we send, generate them, not the way we receive them).
Si I have two ideas, and I ask for help from the Linux-usb mailing list for
this first one.
1 - Does a wayexist to "replay" traffic crom a usb capture?
We might try to take the usb frames generated by Windows, and send them to the
device to see if there is any reaction. It should not be science fiction, I saw
them do that in the eciadsl old project.
2 - The huawei ndis driver: does it work with these devices?
It should be a little bit out-dated now (at least in terms of dates, it might
work as well): the code is A LOT but, just in case, to see if there is any
chances it'll work. It remains to be seen in which kernels it can actually
compile again.
If this works we might analyse what's happening and try to debug this out.
But I really would like this to work in the cdc_ncm driver + huawei_cdc_ncm.
Thank you.
^ permalink raw reply
* Re: [PATCH] SSB / B44: fix WOL for BCM4401
From: Michael Büsch @ 2014-12-01 21:10 UTC (permalink / raw)
To: Andrey Skvortsov
Cc: Rafael J. Wysocki, Gary Zambrano, netdev, linux-kernel, b43-dev,
Rafał Miłecki, Larry Finger
In-Reply-To: <1417466798-15735-1-git-send-email-Andrej.Skvortzov@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 4854 bytes --]
On Mon, 1 Dec 2014 23:46:38 +0300
Andrey Skvortsov <andrej.skvortzov@gmail.com> wrote:
> Wake On Lan was not working on laptop DELL Vostro 1500.
> If WOL was turned on, BCM4401 was powered up in suspend mode. LEDs blinked.
> But the laptop could not be woken up with the Magic Packet. The reason for
> that was that PCIE was not enabled as a system wakeup source and
> therefore the host PCI bridge was not powered up in suspend mode.
> PCIE was not enabled in suspend by PM because no child devices were
> registered as wakeup source during suspend process.
> On laptop BCM4401 is connected through the SSB bus, that is connected to the
> PCI-Express bus. SSB and B44 did not use standard PM wakeup functions
> and did not forward wakeup settings to their parents.
> To fix that B44 driver enables PM wakeup and registers new wakeup source
> using device_set_wakeup_enable(). Wakeup is automatically reported to the parent SSB
> bus via power.wakeup_path. SSB bus enables wakeup for the parent PCI bridge, if there is any
> child devices with enabled wakeup functionality. All other steps are
> done by PM core code.
Thanks, this looks good.
I assume you tested this (I currently don't have a device to test this).
Larry, Rafał, any other b43 user:
Can you please test whether this doesn't cause regressions for suspend/resume on b43?
(Patch is attached as reference)
> Signed-off-by: Andrey Skvortsov <Andrej.Skvortzov@gmail.com>
> ---
> drivers/net/ethernet/broadcom/b44.c | 2 ++
> drivers/ssb/pcihost_wrapper.c | 33 ++++++++++++++++++++++-----------
> 2 files changed, 24 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
> index 416620f..ffeaf47 100644
> --- a/drivers/net/ethernet/broadcom/b44.c
> +++ b/drivers/net/ethernet/broadcom/b44.c
> @@ -2104,6 +2104,7 @@ static int b44_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
> bp->flags &= ~B44_FLAG_WOL_ENABLE;
> spin_unlock_irq(&bp->lock);
>
> + device_set_wakeup_enable(bp->sdev->dev, wol->wolopts & WAKE_MAGIC);
> return 0;
> }
>
> @@ -2452,6 +2453,7 @@ static int b44_init_one(struct ssb_device *sdev,
> }
> }
>
> + device_set_wakeup_capable(sdev->dev, true);
> netdev_info(dev, "%s %pM\n", DRV_DESCRIPTION, dev->dev_addr);
>
> return 0;
> diff --git a/drivers/ssb/pcihost_wrapper.c b/drivers/ssb/pcihost_wrapper.c
> index 69161bb..410215c 100644
> --- a/drivers/ssb/pcihost_wrapper.c
> +++ b/drivers/ssb/pcihost_wrapper.c
> @@ -11,15 +11,17 @@
> * Licensed under the GNU/GPL. See COPYING for details.
> */
>
> +#include <linux/pm.h>
> #include <linux/pci.h>
> #include <linux/export.h>
> #include <linux/slab.h>
> #include <linux/ssb/ssb.h>
>
>
> -#ifdef CONFIG_PM
> -static int ssb_pcihost_suspend(struct pci_dev *dev, pm_message_t state)
> +#ifdef CONFIG_PM_SLEEP
> +static int ssb_pcihost_suspend(struct device *d)
> {
> + struct pci_dev *dev = to_pci_dev(d);
> struct ssb_bus *ssb = pci_get_drvdata(dev);
> int err;
>
> @@ -28,17 +30,23 @@ static int ssb_pcihost_suspend(struct pci_dev *dev, pm_message_t state)
> return err;
> pci_save_state(dev);
> pci_disable_device(dev);
> - pci_set_power_state(dev, pci_choose_state(dev, state));
> +
> + /* if there is a wakeup enabled child device on ssb bus,
> + enable pci wakeup posibility. */
> + device_set_wakeup_enable(d, d->power.wakeup_path);
> +
> + pci_prepare_to_sleep(dev);
>
> return 0;
> }
>
> -static int ssb_pcihost_resume(struct pci_dev *dev)
> +static int ssb_pcihost_resume(struct device *d)
> {
> + struct pci_dev *dev = to_pci_dev(d);
> struct ssb_bus *ssb = pci_get_drvdata(dev);
> int err;
>
> - pci_set_power_state(dev, PCI_D0);
> + pci_back_from_sleep(dev);
> err = pci_enable_device(dev);
> if (err)
> return err;
> @@ -49,10 +57,12 @@ static int ssb_pcihost_resume(struct pci_dev *dev)
>
> return 0;
> }
> -#else /* CONFIG_PM */
> -# define ssb_pcihost_suspend NULL
> -# define ssb_pcihost_resume NULL
> -#endif /* CONFIG_PM */
> +
> +static const struct dev_pm_ops ssb_pcihost_pm_ops = {
> + SET_SYSTEM_SLEEP_PM_OPS(ssb_pcihost_suspend, ssb_pcihost_resume)
> +};
> +
> +#endif /* CONFIG_PM_SLEEP */
>
> static int ssb_pcihost_probe(struct pci_dev *dev,
> const struct pci_device_id *id)
> @@ -115,8 +125,9 @@ int ssb_pcihost_register(struct pci_driver *driver)
> {
> driver->probe = ssb_pcihost_probe;
> driver->remove = ssb_pcihost_remove;
> - driver->suspend = ssb_pcihost_suspend;
> - driver->resume = ssb_pcihost_resume;
> +#ifdef CONFIG_PM_SLEEP
> + driver->driver.pm = &ssb_pcihost_pm_ops;
> +#endif
>
> return pci_register_driver(driver);
> }
--
Michael
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: b44_wol.patch --]
[-- Type: text/x-patch, Size: 4357 bytes --]
From: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Subject: [PATCH] SSB / B44: fix WOL for BCM4401
Wake On Lan was not working on laptop DELL Vostro 1500.
If WOL was turned on, BCM4401 was powered up in suspend mode. LEDs blinked.
But the laptop could not be woken up with the Magic Packet. The reason for
that was that PCIE was not enabled as a system wakeup source and
therefore the host PCI bridge was not powered up in suspend mode.
PCIE was not enabled in suspend by PM because no child devices were
registered as wakeup source during suspend process.
On laptop BCM4401 is connected through the SSB bus, that is connected to the
PCI-Express bus. SSB and B44 did not use standard PM wakeup functions
and did not forward wakeup settings to their parents.
To fix that B44 driver enables PM wakeup and registers new wakeup source
using device_set_wakeup_enable(). Wakeup is automatically reported to the parent SSB
bus via power.wakeup_path. SSB bus enables wakeup for the parent PCI bridge, if there is any
child devices with enabled wakeup functionality. All other steps are
done by PM core code.
Signed-off-by: Andrey Skvortsov <Andrej.Skvortzov@gmail.com>
---
drivers/net/ethernet/broadcom/b44.c | 2 ++
drivers/ssb/pcihost_wrapper.c | 33 ++++++++++++++++++++++-----------
2 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
index 416620f..ffeaf47 100644
--- a/drivers/net/ethernet/broadcom/b44.c
+++ b/drivers/net/ethernet/broadcom/b44.c
@@ -2104,6 +2104,7 @@ static int b44_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
bp->flags &= ~B44_FLAG_WOL_ENABLE;
spin_unlock_irq(&bp->lock);
+ device_set_wakeup_enable(bp->sdev->dev, wol->wolopts & WAKE_MAGIC);
return 0;
}
@@ -2452,6 +2453,7 @@ static int b44_init_one(struct ssb_device *sdev,
}
}
+ device_set_wakeup_capable(sdev->dev, true);
netdev_info(dev, "%s %pM\n", DRV_DESCRIPTION, dev->dev_addr);
return 0;
diff --git a/drivers/ssb/pcihost_wrapper.c b/drivers/ssb/pcihost_wrapper.c
index 69161bb..410215c 100644
--- a/drivers/ssb/pcihost_wrapper.c
+++ b/drivers/ssb/pcihost_wrapper.c
@@ -11,15 +11,17 @@
* Licensed under the GNU/GPL. See COPYING for details.
*/
+#include <linux/pm.h>
#include <linux/pci.h>
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/ssb/ssb.h>
-#ifdef CONFIG_PM
-static int ssb_pcihost_suspend(struct pci_dev *dev, pm_message_t state)
+#ifdef CONFIG_PM_SLEEP
+static int ssb_pcihost_suspend(struct device *d)
{
+ struct pci_dev *dev = to_pci_dev(d);
struct ssb_bus *ssb = pci_get_drvdata(dev);
int err;
@@ -28,17 +30,23 @@ static int ssb_pcihost_suspend(struct pci_dev *dev, pm_message_t state)
return err;
pci_save_state(dev);
pci_disable_device(dev);
- pci_set_power_state(dev, pci_choose_state(dev, state));
+
+ /* if there is a wakeup enabled child device on ssb bus,
+ enable pci wakeup posibility. */
+ device_set_wakeup_enable(d, d->power.wakeup_path);
+
+ pci_prepare_to_sleep(dev);
return 0;
}
-static int ssb_pcihost_resume(struct pci_dev *dev)
+static int ssb_pcihost_resume(struct device *d)
{
+ struct pci_dev *dev = to_pci_dev(d);
struct ssb_bus *ssb = pci_get_drvdata(dev);
int err;
- pci_set_power_state(dev, PCI_D0);
+ pci_back_from_sleep(dev);
err = pci_enable_device(dev);
if (err)
return err;
@@ -49,10 +57,12 @@ static int ssb_pcihost_resume(struct pci_dev *dev)
return 0;
}
-#else /* CONFIG_PM */
-# define ssb_pcihost_suspend NULL
-# define ssb_pcihost_resume NULL
-#endif /* CONFIG_PM */
+
+static const struct dev_pm_ops ssb_pcihost_pm_ops = {
+ SET_SYSTEM_SLEEP_PM_OPS(ssb_pcihost_suspend, ssb_pcihost_resume)
+};
+
+#endif /* CONFIG_PM_SLEEP */
static int ssb_pcihost_probe(struct pci_dev *dev,
const struct pci_device_id *id)
@@ -115,8 +125,9 @@ int ssb_pcihost_register(struct pci_driver *driver)
{
driver->probe = ssb_pcihost_probe;
driver->remove = ssb_pcihost_remove;
- driver->suspend = ssb_pcihost_suspend;
- driver->resume = ssb_pcihost_resume;
+#ifdef CONFIG_PM_SLEEP
+ driver->driver.pm = &ssb_pcihost_pm_ops;
+#endif
return pci_register_driver(driver);
}
--
1.7.2.5
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply related
* Re: [PATCH] wireless/p54: Remove duplicated net2280 header
From: Ricardo Ribalda Delgado @ 2014-12-01 20:56 UTC (permalink / raw)
To: John W. Linville
Cc: Christian Lamparter, LKML, linux-wireless, netdev, David Miller
In-Reply-To: <20141201195924.GA7266@tuxdriver.com>
Hello John
No sorry. I only checked patchwork and the mailing list. I was
expecting the typical mail when a patch is merged into a tree :),
sorry about that, first contrib to the wireless subsystem.
Thanks
On Mon, Dec 1, 2014 at 8:59 PM, John W. Linville <linville@tuxdriver.com> wrote:
> Did you check the wireless-next tree's git logs?
>
> commit a831f20b6d6460640b83644d1c1df6e7e8ca9f68
> Author: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> Date: Mon Nov 24 11:19:51 2014 +0100
>
> wireless/p54: Remove duplicated net2280 header
>
> The usb gadget driver net2280 has exported a header file with the
> register definition of the net2280 chip.
>
> Remove the custom/duplicated header file in favor of that header file
> in include/linux
>
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
>
> On Mon, Dec 01, 2014 at 11:46:43AM +0100, Ricardo Ribalda Delgado wrote:
>> David Miller has marked the patch as "Awaiting Upstream", which I
>> think means that it should be merged through the wireless tree.
>>
>> Any comment from there?
>>
>> On Mon, Nov 24, 2014 at 11:19 AM, Ricardo Ribalda Delgado
>> <ricardo.ribalda@gmail.com> wrote:
>> > The usb gadget driver net2280 has exported a header file with the
>> > register definition of the net2280 chip.
>> >
>> > Remove the custom/duplicated header file in favor of that header file
>> > in include/linux
>> >
>> > Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
>> > ---
>> > drivers/net/wireless/p54/net2280.h | 451 -------------------------------------
>> > drivers/net/wireless/p54/p54usb.h | 13 +-
>> > 2 files changed, 12 insertions(+), 452 deletions(-)
>> > delete mode 100644 drivers/net/wireless/p54/net2280.h
>> >
>> > diff --git a/drivers/net/wireless/p54/net2280.h b/drivers/net/wireless/p54/net2280.h
>> > deleted file mode 100644
>> > index aedfaf2..0000000
>> > --- a/drivers/net/wireless/p54/net2280.h
>> > +++ /dev/null
>> > @@ -1,451 +0,0 @@
>> > -#ifndef NET2280_H
>> > -#define NET2280_H
>> > -/*
>> > - * NetChip 2280 high/full speed USB device controller.
>> > - * Unlike many such controllers, this one talks PCI.
>> > - */
>> > -
>> > -/*
>> > - * Copyright (C) 2002 NetChip Technology, Inc. (http://www.netchip.com)
>> > - * Copyright (C) 2003 David Brownell
>> > - *
>> > - * This program is free software; you can redistribute it and/or modify
>> > - * it under the terms of the GNU General Public License as published by
>> > - * the Free Software Foundation; either version 2 of the License, or
>> > - * (at your option) any later version.
>> > - *
>> > - * This program is distributed in the hope that it will be useful,
>> > - * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>> > - * GNU General Public License for more details.
>> > - *
>> > - * You should have received a copy of the GNU General Public License
>> > - * along with this program; if not, see <http://www.gnu.org/licenses/>.
>> > - */
>> > -
>> > -/*-------------------------------------------------------------------------*/
>> > -
>> > -/* NET2280 MEMORY MAPPED REGISTERS
>> > - *
>> > - * The register layout came from the chip documentation, and the bit
>> > - * number definitions were extracted from chip specification.
>> > - *
>> > - * Use the shift operator ('<<') to build bit masks, with readl/writel
>> > - * to access the registers through PCI.
>> > - */
>> > -
>> > -/* main registers, BAR0 + 0x0000 */
>> > -struct net2280_regs {
>> > - /* offset 0x0000 */
>> > - __le32 devinit;
>> > -#define LOCAL_CLOCK_FREQUENCY 8
>> > -#define FORCE_PCI_RESET 7
>> > -#define PCI_ID 6
>> > -#define PCI_ENABLE 5
>> > -#define FIFO_SOFT_RESET 4
>> > -#define CFG_SOFT_RESET 3
>> > -#define PCI_SOFT_RESET 2
>> > -#define USB_SOFT_RESET 1
>> > -#define M8051_RESET 0
>> > - __le32 eectl;
>> > -#define EEPROM_ADDRESS_WIDTH 23
>> > -#define EEPROM_CHIP_SELECT_ACTIVE 22
>> > -#define EEPROM_PRESENT 21
>> > -#define EEPROM_VALID 20
>> > -#define EEPROM_BUSY 19
>> > -#define EEPROM_CHIP_SELECT_ENABLE 18
>> > -#define EEPROM_BYTE_READ_START 17
>> > -#define EEPROM_BYTE_WRITE_START 16
>> > -#define EEPROM_READ_DATA 8
>> > -#define EEPROM_WRITE_DATA 0
>> > - __le32 eeclkfreq;
>> > - u32 _unused0;
>> > - /* offset 0x0010 */
>> > -
>> > - __le32 pciirqenb0; /* interrupt PCI master ... */
>> > -#define SETUP_PACKET_INTERRUPT_ENABLE 7
>> > -#define ENDPOINT_F_INTERRUPT_ENABLE 6
>> > -#define ENDPOINT_E_INTERRUPT_ENABLE 5
>> > -#define ENDPOINT_D_INTERRUPT_ENABLE 4
>> > -#define ENDPOINT_C_INTERRUPT_ENABLE 3
>> > -#define ENDPOINT_B_INTERRUPT_ENABLE 2
>> > -#define ENDPOINT_A_INTERRUPT_ENABLE 1
>> > -#define ENDPOINT_0_INTERRUPT_ENABLE 0
>> > - __le32 pciirqenb1;
>> > -#define PCI_INTERRUPT_ENABLE 31
>> > -#define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27
>> > -#define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26
>> > -#define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25
>> > -#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20
>> > -#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19
>> > -#define PCI_TARGET_ABORT_ASSERTED_INTERRUPT_ENABLE 18
>> > -#define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17
>> > -#define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16
>> > -#define GPIO_INTERRUPT_ENABLE 13
>> > -#define DMA_D_INTERRUPT_ENABLE 12
>> > -#define DMA_C_INTERRUPT_ENABLE 11
>> > -#define DMA_B_INTERRUPT_ENABLE 10
>> > -#define DMA_A_INTERRUPT_ENABLE 9
>> > -#define EEPROM_DONE_INTERRUPT_ENABLE 8
>> > -#define VBUS_INTERRUPT_ENABLE 7
>> > -#define CONTROL_STATUS_INTERRUPT_ENABLE 6
>> > -#define ROOT_PORT_RESET_INTERRUPT_ENABLE 4
>> > -#define SUSPEND_REQUEST_INTERRUPT_ENABLE 3
>> > -#define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2
>> > -#define RESUME_INTERRUPT_ENABLE 1
>> > -#define SOF_INTERRUPT_ENABLE 0
>> > - __le32 cpu_irqenb0; /* ... or onboard 8051 */
>> > -#define SETUP_PACKET_INTERRUPT_ENABLE 7
>> > -#define ENDPOINT_F_INTERRUPT_ENABLE 6
>> > -#define ENDPOINT_E_INTERRUPT_ENABLE 5
>> > -#define ENDPOINT_D_INTERRUPT_ENABLE 4
>> > -#define ENDPOINT_C_INTERRUPT_ENABLE 3
>> > -#define ENDPOINT_B_INTERRUPT_ENABLE 2
>> > -#define ENDPOINT_A_INTERRUPT_ENABLE 1
>> > -#define ENDPOINT_0_INTERRUPT_ENABLE 0
>> > - __le32 cpu_irqenb1;
>> > -#define CPU_INTERRUPT_ENABLE 31
>> > -#define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27
>> > -#define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26
>> > -#define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25
>> > -#define PCI_INTA_INTERRUPT_ENABLE 24
>> > -#define PCI_PME_INTERRUPT_ENABLE 23
>> > -#define PCI_SERR_INTERRUPT_ENABLE 22
>> > -#define PCI_PERR_INTERRUPT_ENABLE 21
>> > -#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20
>> > -#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19
>> > -#define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17
>> > -#define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16
>> > -#define GPIO_INTERRUPT_ENABLE 13
>> > -#define DMA_D_INTERRUPT_ENABLE 12
>> > -#define DMA_C_INTERRUPT_ENABLE 11
>> > -#define DMA_B_INTERRUPT_ENABLE 10
>> > -#define DMA_A_INTERRUPT_ENABLE 9
>> > -#define EEPROM_DONE_INTERRUPT_ENABLE 8
>> > -#define VBUS_INTERRUPT_ENABLE 7
>> > -#define CONTROL_STATUS_INTERRUPT_ENABLE 6
>> > -#define ROOT_PORT_RESET_INTERRUPT_ENABLE 4
>> > -#define SUSPEND_REQUEST_INTERRUPT_ENABLE 3
>> > -#define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2
>> > -#define RESUME_INTERRUPT_ENABLE 1
>> > -#define SOF_INTERRUPT_ENABLE 0
>> > -
>> > - /* offset 0x0020 */
>> > - u32 _unused1;
>> > - __le32 usbirqenb1;
>> > -#define USB_INTERRUPT_ENABLE 31
>> > -#define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27
>> > -#define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26
>> > -#define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25
>> > -#define PCI_INTA_INTERRUPT_ENABLE 24
>> > -#define PCI_PME_INTERRUPT_ENABLE 23
>> > -#define PCI_SERR_INTERRUPT_ENABLE 22
>> > -#define PCI_PERR_INTERRUPT_ENABLE 21
>> > -#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20
>> > -#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19
>> > -#define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17
>> > -#define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16
>> > -#define GPIO_INTERRUPT_ENABLE 13
>> > -#define DMA_D_INTERRUPT_ENABLE 12
>> > -#define DMA_C_INTERRUPT_ENABLE 11
>> > -#define DMA_B_INTERRUPT_ENABLE 10
>> > -#define DMA_A_INTERRUPT_ENABLE 9
>> > -#define EEPROM_DONE_INTERRUPT_ENABLE 8
>> > -#define VBUS_INTERRUPT_ENABLE 7
>> > -#define CONTROL_STATUS_INTERRUPT_ENABLE 6
>> > -#define ROOT_PORT_RESET_INTERRUPT_ENABLE 4
>> > -#define SUSPEND_REQUEST_INTERRUPT_ENABLE 3
>> > -#define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2
>> > -#define RESUME_INTERRUPT_ENABLE 1
>> > -#define SOF_INTERRUPT_ENABLE 0
>> > - __le32 irqstat0;
>> > -#define INTA_ASSERTED 12
>> > -#define SETUP_PACKET_INTERRUPT 7
>> > -#define ENDPOINT_F_INTERRUPT 6
>> > -#define ENDPOINT_E_INTERRUPT 5
>> > -#define ENDPOINT_D_INTERRUPT 4
>> > -#define ENDPOINT_C_INTERRUPT 3
>> > -#define ENDPOINT_B_INTERRUPT 2
>> > -#define ENDPOINT_A_INTERRUPT 1
>> > -#define ENDPOINT_0_INTERRUPT 0
>> > - __le32 irqstat1;
>> > -#define POWER_STATE_CHANGE_INTERRUPT 27
>> > -#define PCI_ARBITER_TIMEOUT_INTERRUPT 26
>> > -#define PCI_PARITY_ERROR_INTERRUPT 25
>> > -#define PCI_INTA_INTERRUPT 24
>> > -#define PCI_PME_INTERRUPT 23
>> > -#define PCI_SERR_INTERRUPT 22
>> > -#define PCI_PERR_INTERRUPT 21
>> > -#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT 20
>> > -#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT 19
>> > -#define PCI_RETRY_ABORT_INTERRUPT 17
>> > -#define PCI_MASTER_CYCLE_DONE_INTERRUPT 16
>> > -#define GPIO_INTERRUPT 13
>> > -#define DMA_D_INTERRUPT 12
>> > -#define DMA_C_INTERRUPT 11
>> > -#define DMA_B_INTERRUPT 10
>> > -#define DMA_A_INTERRUPT 9
>> > -#define EEPROM_DONE_INTERRUPT 8
>> > -#define VBUS_INTERRUPT 7
>> > -#define CONTROL_STATUS_INTERRUPT 6
>> > -#define ROOT_PORT_RESET_INTERRUPT 4
>> > -#define SUSPEND_REQUEST_INTERRUPT 3
>> > -#define SUSPEND_REQUEST_CHANGE_INTERRUPT 2
>> > -#define RESUME_INTERRUPT 1
>> > -#define SOF_INTERRUPT 0
>> > - /* offset 0x0030 */
>> > - __le32 idxaddr;
>> > - __le32 idxdata;
>> > - __le32 fifoctl;
>> > -#define PCI_BASE2_RANGE 16
>> > -#define IGNORE_FIFO_AVAILABILITY 3
>> > -#define PCI_BASE2_SELECT 2
>> > -#define FIFO_CONFIGURATION_SELECT 0
>> > - u32 _unused2;
>> > - /* offset 0x0040 */
>> > - __le32 memaddr;
>> > -#define START 28
>> > -#define DIRECTION 27
>> > -#define FIFO_DIAGNOSTIC_SELECT 24
>> > -#define MEMORY_ADDRESS 0
>> > - __le32 memdata0;
>> > - __le32 memdata1;
>> > - u32 _unused3;
>> > - /* offset 0x0050 */
>> > - __le32 gpioctl;
>> > -#define GPIO3_LED_SELECT 12
>> > -#define GPIO3_INTERRUPT_ENABLE 11
>> > -#define GPIO2_INTERRUPT_ENABLE 10
>> > -#define GPIO1_INTERRUPT_ENABLE 9
>> > -#define GPIO0_INTERRUPT_ENABLE 8
>> > -#define GPIO3_OUTPUT_ENABLE 7
>> > -#define GPIO2_OUTPUT_ENABLE 6
>> > -#define GPIO1_OUTPUT_ENABLE 5
>> > -#define GPIO0_OUTPUT_ENABLE 4
>> > -#define GPIO3_DATA 3
>> > -#define GPIO2_DATA 2
>> > -#define GPIO1_DATA 1
>> > -#define GPIO0_DATA 0
>> > - __le32 gpiostat;
>> > -#define GPIO3_INTERRUPT 3
>> > -#define GPIO2_INTERRUPT 2
>> > -#define GPIO1_INTERRUPT 1
>> > -#define GPIO0_INTERRUPT 0
>> > -} __packed;
>> > -
>> > -/* usb control, BAR0 + 0x0080 */
>> > -struct net2280_usb_regs {
>> > - /* offset 0x0080 */
>> > - __le32 stdrsp;
>> > -#define STALL_UNSUPPORTED_REQUESTS 31
>> > -#define SET_TEST_MODE 16
>> > -#define GET_OTHER_SPEED_CONFIGURATION 15
>> > -#define GET_DEVICE_QUALIFIER 14
>> > -#define SET_ADDRESS 13
>> > -#define ENDPOINT_SET_CLEAR_HALT 12
>> > -#define DEVICE_SET_CLEAR_DEVICE_REMOTE_WAKEUP 11
>> > -#define GET_STRING_DESCRIPTOR_2 10
>> > -#define GET_STRING_DESCRIPTOR_1 9
>> > -#define GET_STRING_DESCRIPTOR_0 8
>> > -#define GET_SET_INTERFACE 6
>> > -#define GET_SET_CONFIGURATION 5
>> > -#define GET_CONFIGURATION_DESCRIPTOR 4
>> > -#define GET_DEVICE_DESCRIPTOR 3
>> > -#define GET_ENDPOINT_STATUS 2
>> > -#define GET_INTERFACE_STATUS 1
>> > -#define GET_DEVICE_STATUS 0
>> > - __le32 prodvendid;
>> > -#define PRODUCT_ID 16
>> > -#define VENDOR_ID 0
>> > - __le32 relnum;
>> > - __le32 usbctl;
>> > -#define SERIAL_NUMBER_INDEX 16
>> > -#define PRODUCT_ID_STRING_ENABLE 13
>> > -#define VENDOR_ID_STRING_ENABLE 12
>> > -#define USB_ROOT_PORT_WAKEUP_ENABLE 11
>> > -#define VBUS_PIN 10
>> > -#define TIMED_DISCONNECT 9
>> > -#define SUSPEND_IMMEDIATELY 7
>> > -#define SELF_POWERED_USB_DEVICE 6
>> > -#define REMOTE_WAKEUP_SUPPORT 5
>> > -#define PME_POLARITY 4
>> > -#define USB_DETECT_ENABLE 3
>> > -#define PME_WAKEUP_ENABLE 2
>> > -#define DEVICE_REMOTE_WAKEUP_ENABLE 1
>> > -#define SELF_POWERED_STATUS 0
>> > - /* offset 0x0090 */
>> > - __le32 usbstat;
>> > -#define HIGH_SPEED 7
>> > -#define FULL_SPEED 6
>> > -#define GENERATE_RESUME 5
>> > -#define GENERATE_DEVICE_REMOTE_WAKEUP 4
>> > - __le32 xcvrdiag;
>> > -#define FORCE_HIGH_SPEED_MODE 31
>> > -#define FORCE_FULL_SPEED_MODE 30
>> > -#define USB_TEST_MODE 24
>> > -#define LINE_STATE 16
>> > -#define TRANSCEIVER_OPERATION_MODE 2
>> > -#define TRANSCEIVER_SELECT 1
>> > -#define TERMINATION_SELECT 0
>> > - __le32 setup0123;
>> > - __le32 setup4567;
>> > - /* offset 0x0090 */
>> > - u32 _unused0;
>> > - __le32 ouraddr;
>> > -#define FORCE_IMMEDIATE 7
>> > -#define OUR_USB_ADDRESS 0
>> > - __le32 ourconfig;
>> > -} __packed;
>> > -
>> > -/* pci control, BAR0 + 0x0100 */
>> > -struct net2280_pci_regs {
>> > - /* offset 0x0100 */
>> > - __le32 pcimstctl;
>> > -#define PCI_ARBITER_PARK_SELECT 13
>> > -#define PCI_MULTI LEVEL_ARBITER 12
>> > -#define PCI_RETRY_ABORT_ENABLE 11
>> > -#define DMA_MEMORY_WRITE_AND_INVALIDATE_ENABLE 10
>> > -#define DMA_READ_MULTIPLE_ENABLE 9
>> > -#define DMA_READ_LINE_ENABLE 8
>> > -#define PCI_MASTER_COMMAND_SELECT 6
>> > -#define MEM_READ_OR_WRITE 0
>> > -#define IO_READ_OR_WRITE 1
>> > -#define CFG_READ_OR_WRITE 2
>> > -#define PCI_MASTER_START 5
>> > -#define PCI_MASTER_READ_WRITE 4
>> > -#define PCI_MASTER_WRITE 0
>> > -#define PCI_MASTER_READ 1
>> > -#define PCI_MASTER_BYTE_WRITE_ENABLES 0
>> > - __le32 pcimstaddr;
>> > - __le32 pcimstdata;
>> > - __le32 pcimststat;
>> > -#define PCI_ARBITER_CLEAR 2
>> > -#define PCI_EXTERNAL_ARBITER 1
>> > -#define PCI_HOST_MODE 0
>> > -} __packed;
>> > -
>> > -/* dma control, BAR0 + 0x0180 ... array of four structs like this,
>> > - * for channels 0..3. see also struct net2280_dma: descriptor
>> > - * that can be loaded into some of these registers.
>> > - */
>> > -struct net2280_dma_regs { /* [11.7] */
>> > - /* offset 0x0180, 0x01a0, 0x01c0, 0x01e0, */
>> > - __le32 dmactl;
>> > -#define DMA_SCATTER_GATHER_DONE_INTERRUPT_ENABLE 25
>> > -#define DMA_CLEAR_COUNT_ENABLE 21
>> > -#define DESCRIPTOR_POLLING_RATE 19
>> > -#define POLL_CONTINUOUS 0
>> > -#define POLL_1_USEC 1
>> > -#define POLL_100_USEC 2
>> > -#define POLL_1_MSEC 3
>> > -#define DMA_VALID_BIT_POLLING_ENABLE 18
>> > -#define DMA_VALID_BIT_ENABLE 17
>> > -#define DMA_SCATTER_GATHER_ENABLE 16
>> > -#define DMA_OUT_AUTO_START_ENABLE 4
>> > -#define DMA_PREEMPT_ENABLE 3
>> > -#define DMA_FIFO_VALIDATE 2
>> > -#define DMA_ENABLE 1
>> > -#define DMA_ADDRESS_HOLD 0
>> > - __le32 dmastat;
>> > -#define DMA_SCATTER_GATHER_DONE_INTERRUPT 25
>> > -#define DMA_TRANSACTION_DONE_INTERRUPT 24
>> > -#define DMA_ABORT 1
>> > -#define DMA_START 0
>> > - u32 _unused0[2];
>> > - /* offset 0x0190, 0x01b0, 0x01d0, 0x01f0, */
>> > - __le32 dmacount;
>> > -#define VALID_BIT 31
>> > -#define DMA_DIRECTION 30
>> > -#define DMA_DONE_INTERRUPT_ENABLE 29
>> > -#define END_OF_CHAIN 28
>> > -#define DMA_BYTE_COUNT_MASK ((1<<24)-1)
>> > -#define DMA_BYTE_COUNT 0
>> > - __le32 dmaaddr;
>> > - __le32 dmadesc;
>> > - u32 _unused1;
>> > -} __packed;
>> > -
>> > -/* dedicated endpoint registers, BAR0 + 0x0200 */
>> > -
>> > -struct net2280_dep_regs { /* [11.8] */
>> > - /* offset 0x0200, 0x0210, 0x220, 0x230, 0x240 */
>> > - __le32 dep_cfg;
>> > - /* offset 0x0204, 0x0214, 0x224, 0x234, 0x244 */
>> > - __le32 dep_rsp;
>> > - u32 _unused[2];
>> > -} __packed;
>> > -
>> > -/* configurable endpoint registers, BAR0 + 0x0300 ... array of seven structs
>> > - * like this, for ep0 then the configurable endpoints A..F
>> > - * ep0 reserved for control; E and F have only 64 bytes of fifo
>> > - */
>> > -struct net2280_ep_regs { /* [11.9] */
>> > - /* offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0 */
>> > - __le32 ep_cfg;
>> > -#define ENDPOINT_BYTE_COUNT 16
>> > -#define ENDPOINT_ENABLE 10
>> > -#define ENDPOINT_TYPE 8
>> > -#define ENDPOINT_DIRECTION 7
>> > -#define ENDPOINT_NUMBER 0
>> > - __le32 ep_rsp;
>> > -#define SET_NAK_OUT_PACKETS 15
>> > -#define SET_EP_HIDE_STATUS_PHASE 14
>> > -#define SET_EP_FORCE_CRC_ERROR 13
>> > -#define SET_INTERRUPT_MODE 12
>> > -#define SET_CONTROL_STATUS_PHASE_HANDSHAKE 11
>> > -#define SET_NAK_OUT_PACKETS_MODE 10
>> > -#define SET_ENDPOINT_TOGGLE 9
>> > -#define SET_ENDPOINT_HALT 8
>> > -#define CLEAR_NAK_OUT_PACKETS 7
>> > -#define CLEAR_EP_HIDE_STATUS_PHASE 6
>> > -#define CLEAR_EP_FORCE_CRC_ERROR 5
>> > -#define CLEAR_INTERRUPT_MODE 4
>> > -#define CLEAR_CONTROL_STATUS_PHASE_HANDSHAKE 3
>> > -#define CLEAR_NAK_OUT_PACKETS_MODE 2
>> > -#define CLEAR_ENDPOINT_TOGGLE 1
>> > -#define CLEAR_ENDPOINT_HALT 0
>> > - __le32 ep_irqenb;
>> > -#define SHORT_PACKET_OUT_DONE_INTERRUPT_ENABLE 6
>> > -#define SHORT_PACKET_TRANSFERRED_INTERRUPT_ENABLE 5
>> > -#define DATA_PACKET_RECEIVED_INTERRUPT_ENABLE 3
>> > -#define DATA_PACKET_TRANSMITTED_INTERRUPT_ENABLE 2
>> > -#define DATA_OUT_PING_TOKEN_INTERRUPT_ENABLE 1
>> > -#define DATA_IN_TOKEN_INTERRUPT_ENABLE 0
>> > - __le32 ep_stat;
>> > -#define FIFO_VALID_COUNT 24
>> > -#define HIGH_BANDWIDTH_OUT_TRANSACTION_PID 22
>> > -#define TIMEOUT 21
>> > -#define USB_STALL_SENT 20
>> > -#define USB_IN_NAK_SENT 19
>> > -#define USB_IN_ACK_RCVD 18
>> > -#define USB_OUT_PING_NAK_SENT 17
>> > -#define USB_OUT_ACK_SENT 16
>> > -#define FIFO_OVERFLOW 13
>> > -#define FIFO_UNDERFLOW 12
>> > -#define FIFO_FULL 11
>> > -#define FIFO_EMPTY 10
>> > -#define FIFO_FLUSH 9
>> > -#define SHORT_PACKET_OUT_DONE_INTERRUPT 6
>> > -#define SHORT_PACKET_TRANSFERRED_INTERRUPT 5
>> > -#define NAK_OUT_PACKETS 4
>> > -#define DATA_PACKET_RECEIVED_INTERRUPT 3
>> > -#define DATA_PACKET_TRANSMITTED_INTERRUPT 2
>> > -#define DATA_OUT_PING_TOKEN_INTERRUPT 1
>> > -#define DATA_IN_TOKEN_INTERRUPT 0
>> > - /* offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 */
>> > - __le32 ep_avail;
>> > - __le32 ep_data;
>> > - u32 _unused0[2];
>> > -} __packed;
>> > -
>> > -struct net2280_reg_write {
>> > - __le16 port;
>> > - __le32 addr;
>> > - __le32 val;
>> > -} __packed;
>> > -
>> > -struct net2280_reg_read {
>> > - __le16 port;
>> > - __le32 addr;
>> > -} __packed;
>> > -#endif /* NET2280_H */
>> > diff --git a/drivers/net/wireless/p54/p54usb.h b/drivers/net/wireless/p54/p54usb.h
>> > index d273be7..a5f5f0f 100644
>> > --- a/drivers/net/wireless/p54/p54usb.h
>> > +++ b/drivers/net/wireless/p54/p54usb.h
>> > @@ -16,7 +16,7 @@
>> >
>> > /* for isl3886 register definitions used on ver 1 devices */
>> > #include "p54pci.h"
>> > -#include "net2280.h"
>> > +#include <linux/usb/net2280.h>
>> >
>> > /* pci */
>> > #define NET2280_BASE 0x10000000
>> > @@ -93,6 +93,17 @@ enum net2280_op_type {
>> > NET2280_DEV_CFG_U16 = 0x0883
>> > };
>> >
>> > +struct net2280_reg_write {
>> > + __le16 port;
>> > + __le32 addr;
>> > + __le32 val;
>> > +} __packed;
>> > +
>> > +struct net2280_reg_read {
>> > + __le16 port;
>> > + __le32 addr;
>> > +} __packed;
>> > +
>> > #define P54U_FW_BLOCK 2048
>> >
>> > #define X2_SIGNATURE "x2 "
>> > --
>> > 2.1.3
>> >
>>
>>
>>
>> --
>> Ricardo Ribalda
>>
>
> --
> John W. Linville Someday the world will need a hero, and you
> linville@tuxdriver.com might be all we have. Be ready.
--
Ricardo Ribalda
^ permalink raw reply
* Re: no connectivity on PF with Intel 82599/SR-IOV/OVS
From: Alexei Starovoitov @ 2014-12-01 20:47 UTC (permalink / raw)
To: Dmitry N., netdev@vger.kernel.org; +Cc: linux-kernel@vger.kernel.org
cc-ing netdev
On Mon, Dec 1, 2014 at 3:45 AM, Dmitry N. <plretbox@gmail.com> wrote:
> Hello all.
>
> I'm having an issue with SR-IOV on 82599 NIC in lab env. Basically
> what I have is Ubuntu 12.04 with a set of vanilla kernels and Open
> vSwitch.
>
> A simplified scheme for ovs setup:
> br-mgmt -> [vlan 102]br-eth0 -> eth0 -> fabric
>
> When VFs are disabled, connectivity works fine. However when at least
> one VF is enabled, traffic just doesn't go any further than br-eth0.
> Oddly enough, it acts this way only if VLAN is configured on br-eth0
> via OVS. When I try to configure VLAN with ip link, it works just
> fine.
>
> It's not an udev issue because re-adding eth0 to br-eth0 doesn't help.
> I've tried different OVS and ixgbe/ixgbevf versions against different
> kernel versions and ruled out issues with OVS and ixgbe.
>
> This could be a kernel bug.
>
> Kernel versions I've tried:
> 3.11.0 works fine
> 3.12.24 has this issue
> 3.14.23 has this issue
> 3.15.10 has this issue
> 3.16.7 and later kernels: the situation is opposite: when VFs are
> disabled, there is no connectivity on PF; as soon as at leas 1 VF is
> enabled, connectivity appears.
>
> OVS versions:
> 2.3.0 for user space
> 2.3.0 (and kernel native where 2.3.0 is not supported - starting with
> 3.15.x) for kernel space
>
> ixgbe:
> latest from Intel website (3.22.3)
>
> ixgbevf:
> latest from Intel website (2.15.3)
>
> Any suggestions? Thanks.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply
* [PATCH] SSB / B44: fix WOL for BCM4401
From: Andrey Skvortsov @ 2014-12-01 20:46 UTC (permalink / raw)
To: Rafael J. Wysocki, Gary Zambrano, Michael Buesch, netdev,
linux-kernel
Cc: Andrey Skvortsov
In-Reply-To: <20141201111125.GA11974@localhost.localdomain>
Wake On Lan was not working on laptop DELL Vostro 1500.
If WOL was turned on, BCM4401 was powered up in suspend mode. LEDs blinked.
But the laptop could not be woken up with the Magic Packet. The reason for
that was that PCIE was not enabled as a system wakeup source and
therefore the host PCI bridge was not powered up in suspend mode.
PCIE was not enabled in suspend by PM because no child devices were
registered as wakeup source during suspend process.
On laptop BCM4401 is connected through the SSB bus, that is connected to the
PCI-Express bus. SSB and B44 did not use standard PM wakeup functions
and did not forward wakeup settings to their parents.
To fix that B44 driver enables PM wakeup and registers new wakeup source
using device_set_wakeup_enable(). Wakeup is automatically reported to the parent SSB
bus via power.wakeup_path. SSB bus enables wakeup for the parent PCI bridge, if there is any
child devices with enabled wakeup functionality. All other steps are
done by PM core code.
Signed-off-by: Andrey Skvortsov <Andrej.Skvortzov@gmail.com>
---
drivers/net/ethernet/broadcom/b44.c | 2 ++
drivers/ssb/pcihost_wrapper.c | 33 ++++++++++++++++++++++-----------
2 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
index 416620f..ffeaf47 100644
--- a/drivers/net/ethernet/broadcom/b44.c
+++ b/drivers/net/ethernet/broadcom/b44.c
@@ -2104,6 +2104,7 @@ static int b44_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
bp->flags &= ~B44_FLAG_WOL_ENABLE;
spin_unlock_irq(&bp->lock);
+ device_set_wakeup_enable(bp->sdev->dev, wol->wolopts & WAKE_MAGIC);
return 0;
}
@@ -2452,6 +2453,7 @@ static int b44_init_one(struct ssb_device *sdev,
}
}
+ device_set_wakeup_capable(sdev->dev, true);
netdev_info(dev, "%s %pM\n", DRV_DESCRIPTION, dev->dev_addr);
return 0;
diff --git a/drivers/ssb/pcihost_wrapper.c b/drivers/ssb/pcihost_wrapper.c
index 69161bb..410215c 100644
--- a/drivers/ssb/pcihost_wrapper.c
+++ b/drivers/ssb/pcihost_wrapper.c
@@ -11,15 +11,17 @@
* Licensed under the GNU/GPL. See COPYING for details.
*/
+#include <linux/pm.h>
#include <linux/pci.h>
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/ssb/ssb.h>
-#ifdef CONFIG_PM
-static int ssb_pcihost_suspend(struct pci_dev *dev, pm_message_t state)
+#ifdef CONFIG_PM_SLEEP
+static int ssb_pcihost_suspend(struct device *d)
{
+ struct pci_dev *dev = to_pci_dev(d);
struct ssb_bus *ssb = pci_get_drvdata(dev);
int err;
@@ -28,17 +30,23 @@ static int ssb_pcihost_suspend(struct pci_dev *dev, pm_message_t state)
return err;
pci_save_state(dev);
pci_disable_device(dev);
- pci_set_power_state(dev, pci_choose_state(dev, state));
+
+ /* if there is a wakeup enabled child device on ssb bus,
+ enable pci wakeup posibility. */
+ device_set_wakeup_enable(d, d->power.wakeup_path);
+
+ pci_prepare_to_sleep(dev);
return 0;
}
-static int ssb_pcihost_resume(struct pci_dev *dev)
+static int ssb_pcihost_resume(struct device *d)
{
+ struct pci_dev *dev = to_pci_dev(d);
struct ssb_bus *ssb = pci_get_drvdata(dev);
int err;
- pci_set_power_state(dev, PCI_D0);
+ pci_back_from_sleep(dev);
err = pci_enable_device(dev);
if (err)
return err;
@@ -49,10 +57,12 @@ static int ssb_pcihost_resume(struct pci_dev *dev)
return 0;
}
-#else /* CONFIG_PM */
-# define ssb_pcihost_suspend NULL
-# define ssb_pcihost_resume NULL
-#endif /* CONFIG_PM */
+
+static const struct dev_pm_ops ssb_pcihost_pm_ops = {
+ SET_SYSTEM_SLEEP_PM_OPS(ssb_pcihost_suspend, ssb_pcihost_resume)
+};
+
+#endif /* CONFIG_PM_SLEEP */
static int ssb_pcihost_probe(struct pci_dev *dev,
const struct pci_device_id *id)
@@ -115,8 +125,9 @@ int ssb_pcihost_register(struct pci_driver *driver)
{
driver->probe = ssb_pcihost_probe;
driver->remove = ssb_pcihost_remove;
- driver->suspend = ssb_pcihost_suspend;
- driver->resume = ssb_pcihost_resume;
+#ifdef CONFIG_PM_SLEEP
+ driver->driver.pm = &ssb_pcihost_pm_ops;
+#endif
return pci_register_driver(driver);
}
--
1.7.2.5
^ permalink raw reply related
* Re: [PATCH 1/1] net-PA Semi: Deletion of unnecessary checks before the function call "pci_dev_put"
From: Olof Johansson @ 2014-12-01 20:36 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Network Development, LKML, kernel-janitors, Julia Lawall
In-Reply-To: <547A09B1.9090102@users.sourceforge.net>
On Sat, Nov 29, 2014 at 10:00 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 29 Nov 2014 18:55:40 +0100
>
> The pci_dev_put() function tests whether its argument is NULL
> and then returns immediately. Thus the test around the call
> is not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
For this particular case:
Acked-by: Olof Johansson <olof@lixom.net>
Note that the "this might cause problems with backports" case is
mostly academic in the scope of _this particular driver_. It's still a
very valid discussion and issue though.
So I'll be happy to give the ack on this driver, but the larger
problem needs consideration still.
-Olof
^ permalink raw reply
* Re: net-PA Semi: Deletion of unnecessary checks before the function call "pci_dev_put"
From: Julia Lawall @ 2014-12-01 20:34 UTC (permalink / raw)
To: Johannes Berg
Cc: SF Markus Elfring, Lino Sanfilippo, Olof Johansson, netdev,
backports, LKML, kernel-janitors, Luis R. Rodriguez
In-Reply-To: <1417465745.28610.0.camel@sipsolutions.net>
On Mon, 1 Dec 2014, Johannes Berg wrote:
> On Mon, 2014-12-01 at 02:34 +0100, SF Markus Elfring wrote:
>
> > > Some of those NULL pointer checks on input parameters may have been
> > > added subsequently to functions. So there may be older kernel versions
> > > out there in which those checks dont exists in some cases. If some of
> > > the now "cleaned up" code is backported to such a kernel chances are
> > > good that those missing checks are overseen. And then neither caller nor
> > > callee is doing the NULL pointer check.
>
> > I assume that a few backporters can tell you more about their corresponding
> > software development experiences.
> > http://www.do-not-panic.com/2014/04/automatic-linux-kernel-backporting-with-coccinelle.html
>
> In such cases we just provide an appropriate wrapper and replace callers
> of the original function by callers of the wrapper, typically with a
> #define.
>
> So this kind of evolution is no problem for the (automated) backports
> using the backports project - although it can be difficult to detect
> such a thing is needed.
That is exactly the problem...
julia
^ permalink raw reply
* Re: net-PA Semi: Deletion of unnecessary checks before the function call "pci_dev_put"
From: Johannes Berg @ 2014-12-01 20:29 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Lino Sanfilippo, Olof Johansson, netdev, backports, LKML,
kernel-janitors, Julia Lawall, Luis R. Rodriguez
In-Reply-To: <547BC5AD.6090500@users.sourceforge.net>
On Mon, 2014-12-01 at 02:34 +0100, SF Markus Elfring wrote:
> > Some of those NULL pointer checks on input parameters may have been
> > added subsequently to functions. So there may be older kernel versions
> > out there in which those checks dont exists in some cases. If some of
> > the now "cleaned up" code is backported to such a kernel chances are
> > good that those missing checks are overseen. And then neither caller nor
> > callee is doing the NULL pointer check.
> I assume that a few backporters can tell you more about their corresponding
> software development experiences.
> http://www.do-not-panic.com/2014/04/automatic-linux-kernel-backporting-with-coccinelle.html
In such cases we just provide an appropriate wrapper and replace callers
of the original function by callers of the wrapper, typically with a
#define.
So this kind of evolution is no problem for the (automated) backports
using the backports project - although it can be difficult to detect
such a thing is needed.
johannes
^ permalink raw reply
* Re: [PATCH] stmmac: platform: fix stmmac probe failure
From: Dinh Nguyen @ 2014-12-01 20:14 UTC (permalink / raw)
To: davem, peppe.cavallaro
Cc: dinh.linux, maxime.ripard, olof, vbridger, netdev, linux-kernel
In-Reply-To: <1417464054-8777-1-git-send-email-dinguyen@opensource.altera.com>
Apologies for the noise, but it looks like Arnd has already send a patch
for this.
http://www.spinics.net/lists/netdev/msg306603.html
Dinh
On 12/1/14, 2:00 PM, dinguyen@opensource.altera.com wrote:
> From: Dinh Nguyen <dinguyen@opensource.altera.com>
>
> The commit 571dcfde23712b ("stmmac: platform: fix default values of the filter
> bins setting") broke support for stmmac probe for all CONFIG_OF platforms.
>
> [ 0.743567] Unable to handle kernel NULL pointer dereference at virtual address 00000048
> [ 0.751679] pgd = c0004000
> [ 0.754384] [00000048] *pgd=00000000
> [ 0.757983] Internal error: Oops: 805 [#1] SMP ARM
> [ 0.762774] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.18.0-rc7 #1
> [ 0.769034] task: ee86c000 ti: ee870000 task.ti: ee870000
> [ 0.774429] PC is at stmmac_pltfr_probe+0x40/0x5d0
> [ 0.779217] LR is at devm_ioremap_nocache+0x54/0x74
> ...
> [ 0.951644] [<c0287938>] (stmmac_pltfr_probe) from [<c0234c4c>] (platform_drv_probe+0x44/0xa4)
> [ 0.960250] [<c0234c4c>] (platform_drv_probe) from [<c023390c>] (driver_probe_device+0x10c/0x240)
> [ 0.969113] [<c023390c>] (driver_probe_device) from [<c0233b10>] (__driver_attach+0x8c/0x90)
> [ 0.977544] [<c0233b10>] (__driver_attach) from [<c02320fc>] (bus_for_each_dev+0x6c/0xa0)
>
> The reason is that in stmmac_pltfr_probe(), the plat_dat on a CONFIG_OF
> platform is NULL until devm_kzalloc() is called to allocate plat_dat.
>
> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index 5b0da39..62c9e75 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -265,12 +265,6 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
>
> plat_dat = dev_get_platdata(&pdev->dev);
>
> - /* Set default value for multicast hash bins */
> - plat_dat->multicast_filter_bins = HASH_TABLE_SIZE;
> -
> - /* Set default value for unicast filter entries */
> - plat_dat->unicast_filter_entries = 1;
> -
> if (pdev->dev.of_node) {
> if (!plat_dat)
> plat_dat = devm_kzalloc(&pdev->dev,
> @@ -288,6 +282,12 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
> }
> }
>
> + /* Set default value for multicast hash bins */
> + plat_dat->multicast_filter_bins = HASH_TABLE_SIZE;
> +
> + /* Set default value for unicast filter entries */
> + plat_dat->unicast_filter_entries = 1;
> +
> /* Custom setup (if needed) */
> if (plat_dat->setup) {
> plat_dat->bsp_priv = plat_dat->setup(pdev);
>
^ permalink raw reply
* [PATCH] stmmac: platform: fix stmmac probe failure
From: dinguyen @ 2014-12-01 20:00 UTC (permalink / raw)
To: davem, peppe.cavallaro
Cc: dinh.linux, maxime.ripard, olof, vbridger, netdev, linux-kernel,
Dinh Nguyen
From: Dinh Nguyen <dinguyen@opensource.altera.com>
The commit 571dcfde23712b ("stmmac: platform: fix default values of the filter
bins setting") broke support for stmmac probe for all CONFIG_OF platforms.
[ 0.743567] Unable to handle kernel NULL pointer dereference at virtual address 00000048
[ 0.751679] pgd = c0004000
[ 0.754384] [00000048] *pgd=00000000
[ 0.757983] Internal error: Oops: 805 [#1] SMP ARM
[ 0.762774] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.18.0-rc7 #1
[ 0.769034] task: ee86c000 ti: ee870000 task.ti: ee870000
[ 0.774429] PC is at stmmac_pltfr_probe+0x40/0x5d0
[ 0.779217] LR is at devm_ioremap_nocache+0x54/0x74
...
[ 0.951644] [<c0287938>] (stmmac_pltfr_probe) from [<c0234c4c>] (platform_drv_probe+0x44/0xa4)
[ 0.960250] [<c0234c4c>] (platform_drv_probe) from [<c023390c>] (driver_probe_device+0x10c/0x240)
[ 0.969113] [<c023390c>] (driver_probe_device) from [<c0233b10>] (__driver_attach+0x8c/0x90)
[ 0.977544] [<c0233b10>] (__driver_attach) from [<c02320fc>] (bus_for_each_dev+0x6c/0xa0)
The reason is that in stmmac_pltfr_probe(), the plat_dat on a CONFIG_OF
platform is NULL until devm_kzalloc() is called to allocate plat_dat.
Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 5b0da39..62c9e75 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -265,12 +265,6 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
plat_dat = dev_get_platdata(&pdev->dev);
- /* Set default value for multicast hash bins */
- plat_dat->multicast_filter_bins = HASH_TABLE_SIZE;
-
- /* Set default value for unicast filter entries */
- plat_dat->unicast_filter_entries = 1;
-
if (pdev->dev.of_node) {
if (!plat_dat)
plat_dat = devm_kzalloc(&pdev->dev,
@@ -288,6 +282,12 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
}
}
+ /* Set default value for multicast hash bins */
+ plat_dat->multicast_filter_bins = HASH_TABLE_SIZE;
+
+ /* Set default value for unicast filter entries */
+ plat_dat->unicast_filter_entries = 1;
+
/* Custom setup (if needed) */
if (plat_dat->setup) {
plat_dat->bsp_priv = plat_dat->setup(pdev);
--
2.0.3
^ permalink raw reply related
* Re: [PATCH] wireless/p54: Remove duplicated net2280 header
From: John W. Linville @ 2014-12-01 19:59 UTC (permalink / raw)
To: Ricardo Ribalda Delgado
Cc: Christian Lamparter, LKML, linux-wireless, netdev, David Miller
In-Reply-To: <CAPybu_1LBqp5JKBUr85HWfkcSJH5vy2zY9Z13Xvw7W1xyjKOzg@mail.gmail.com>
Did you check the wireless-next tree's git logs?
commit a831f20b6d6460640b83644d1c1df6e7e8ca9f68
Author: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Date: Mon Nov 24 11:19:51 2014 +0100
wireless/p54: Remove duplicated net2280 header
The usb gadget driver net2280 has exported a header file with the
register definition of the net2280 chip.
Remove the custom/duplicated header file in favor of that header file
in include/linux
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
On Mon, Dec 01, 2014 at 11:46:43AM +0100, Ricardo Ribalda Delgado wrote:
> David Miller has marked the patch as "Awaiting Upstream", which I
> think means that it should be merged through the wireless tree.
>
> Any comment from there?
>
> On Mon, Nov 24, 2014 at 11:19 AM, Ricardo Ribalda Delgado
> <ricardo.ribalda@gmail.com> wrote:
> > The usb gadget driver net2280 has exported a header file with the
> > register definition of the net2280 chip.
> >
> > Remove the custom/duplicated header file in favor of that header file
> > in include/linux
> >
> > Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> > ---
> > drivers/net/wireless/p54/net2280.h | 451 -------------------------------------
> > drivers/net/wireless/p54/p54usb.h | 13 +-
> > 2 files changed, 12 insertions(+), 452 deletions(-)
> > delete mode 100644 drivers/net/wireless/p54/net2280.h
> >
> > diff --git a/drivers/net/wireless/p54/net2280.h b/drivers/net/wireless/p54/net2280.h
> > deleted file mode 100644
> > index aedfaf2..0000000
> > --- a/drivers/net/wireless/p54/net2280.h
> > +++ /dev/null
> > @@ -1,451 +0,0 @@
> > -#ifndef NET2280_H
> > -#define NET2280_H
> > -/*
> > - * NetChip 2280 high/full speed USB device controller.
> > - * Unlike many such controllers, this one talks PCI.
> > - */
> > -
> > -/*
> > - * Copyright (C) 2002 NetChip Technology, Inc. (http://www.netchip.com)
> > - * Copyright (C) 2003 David Brownell
> > - *
> > - * This program is free software; you can redistribute it and/or modify
> > - * it under the terms of the GNU General Public License as published by
> > - * the Free Software Foundation; either version 2 of the License, or
> > - * (at your option) any later version.
> > - *
> > - * This program is distributed in the hope that it will be useful,
> > - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> > - * GNU General Public License for more details.
> > - *
> > - * You should have received a copy of the GNU General Public License
> > - * along with this program; if not, see <http://www.gnu.org/licenses/>.
> > - */
> > -
> > -/*-------------------------------------------------------------------------*/
> > -
> > -/* NET2280 MEMORY MAPPED REGISTERS
> > - *
> > - * The register layout came from the chip documentation, and the bit
> > - * number definitions were extracted from chip specification.
> > - *
> > - * Use the shift operator ('<<') to build bit masks, with readl/writel
> > - * to access the registers through PCI.
> > - */
> > -
> > -/* main registers, BAR0 + 0x0000 */
> > -struct net2280_regs {
> > - /* offset 0x0000 */
> > - __le32 devinit;
> > -#define LOCAL_CLOCK_FREQUENCY 8
> > -#define FORCE_PCI_RESET 7
> > -#define PCI_ID 6
> > -#define PCI_ENABLE 5
> > -#define FIFO_SOFT_RESET 4
> > -#define CFG_SOFT_RESET 3
> > -#define PCI_SOFT_RESET 2
> > -#define USB_SOFT_RESET 1
> > -#define M8051_RESET 0
> > - __le32 eectl;
> > -#define EEPROM_ADDRESS_WIDTH 23
> > -#define EEPROM_CHIP_SELECT_ACTIVE 22
> > -#define EEPROM_PRESENT 21
> > -#define EEPROM_VALID 20
> > -#define EEPROM_BUSY 19
> > -#define EEPROM_CHIP_SELECT_ENABLE 18
> > -#define EEPROM_BYTE_READ_START 17
> > -#define EEPROM_BYTE_WRITE_START 16
> > -#define EEPROM_READ_DATA 8
> > -#define EEPROM_WRITE_DATA 0
> > - __le32 eeclkfreq;
> > - u32 _unused0;
> > - /* offset 0x0010 */
> > -
> > - __le32 pciirqenb0; /* interrupt PCI master ... */
> > -#define SETUP_PACKET_INTERRUPT_ENABLE 7
> > -#define ENDPOINT_F_INTERRUPT_ENABLE 6
> > -#define ENDPOINT_E_INTERRUPT_ENABLE 5
> > -#define ENDPOINT_D_INTERRUPT_ENABLE 4
> > -#define ENDPOINT_C_INTERRUPT_ENABLE 3
> > -#define ENDPOINT_B_INTERRUPT_ENABLE 2
> > -#define ENDPOINT_A_INTERRUPT_ENABLE 1
> > -#define ENDPOINT_0_INTERRUPT_ENABLE 0
> > - __le32 pciirqenb1;
> > -#define PCI_INTERRUPT_ENABLE 31
> > -#define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27
> > -#define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26
> > -#define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25
> > -#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20
> > -#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19
> > -#define PCI_TARGET_ABORT_ASSERTED_INTERRUPT_ENABLE 18
> > -#define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17
> > -#define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16
> > -#define GPIO_INTERRUPT_ENABLE 13
> > -#define DMA_D_INTERRUPT_ENABLE 12
> > -#define DMA_C_INTERRUPT_ENABLE 11
> > -#define DMA_B_INTERRUPT_ENABLE 10
> > -#define DMA_A_INTERRUPT_ENABLE 9
> > -#define EEPROM_DONE_INTERRUPT_ENABLE 8
> > -#define VBUS_INTERRUPT_ENABLE 7
> > -#define CONTROL_STATUS_INTERRUPT_ENABLE 6
> > -#define ROOT_PORT_RESET_INTERRUPT_ENABLE 4
> > -#define SUSPEND_REQUEST_INTERRUPT_ENABLE 3
> > -#define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2
> > -#define RESUME_INTERRUPT_ENABLE 1
> > -#define SOF_INTERRUPT_ENABLE 0
> > - __le32 cpu_irqenb0; /* ... or onboard 8051 */
> > -#define SETUP_PACKET_INTERRUPT_ENABLE 7
> > -#define ENDPOINT_F_INTERRUPT_ENABLE 6
> > -#define ENDPOINT_E_INTERRUPT_ENABLE 5
> > -#define ENDPOINT_D_INTERRUPT_ENABLE 4
> > -#define ENDPOINT_C_INTERRUPT_ENABLE 3
> > -#define ENDPOINT_B_INTERRUPT_ENABLE 2
> > -#define ENDPOINT_A_INTERRUPT_ENABLE 1
> > -#define ENDPOINT_0_INTERRUPT_ENABLE 0
> > - __le32 cpu_irqenb1;
> > -#define CPU_INTERRUPT_ENABLE 31
> > -#define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27
> > -#define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26
> > -#define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25
> > -#define PCI_INTA_INTERRUPT_ENABLE 24
> > -#define PCI_PME_INTERRUPT_ENABLE 23
> > -#define PCI_SERR_INTERRUPT_ENABLE 22
> > -#define PCI_PERR_INTERRUPT_ENABLE 21
> > -#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20
> > -#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19
> > -#define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17
> > -#define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16
> > -#define GPIO_INTERRUPT_ENABLE 13
> > -#define DMA_D_INTERRUPT_ENABLE 12
> > -#define DMA_C_INTERRUPT_ENABLE 11
> > -#define DMA_B_INTERRUPT_ENABLE 10
> > -#define DMA_A_INTERRUPT_ENABLE 9
> > -#define EEPROM_DONE_INTERRUPT_ENABLE 8
> > -#define VBUS_INTERRUPT_ENABLE 7
> > -#define CONTROL_STATUS_INTERRUPT_ENABLE 6
> > -#define ROOT_PORT_RESET_INTERRUPT_ENABLE 4
> > -#define SUSPEND_REQUEST_INTERRUPT_ENABLE 3
> > -#define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2
> > -#define RESUME_INTERRUPT_ENABLE 1
> > -#define SOF_INTERRUPT_ENABLE 0
> > -
> > - /* offset 0x0020 */
> > - u32 _unused1;
> > - __le32 usbirqenb1;
> > -#define USB_INTERRUPT_ENABLE 31
> > -#define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27
> > -#define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26
> > -#define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25
> > -#define PCI_INTA_INTERRUPT_ENABLE 24
> > -#define PCI_PME_INTERRUPT_ENABLE 23
> > -#define PCI_SERR_INTERRUPT_ENABLE 22
> > -#define PCI_PERR_INTERRUPT_ENABLE 21
> > -#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20
> > -#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19
> > -#define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17
> > -#define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16
> > -#define GPIO_INTERRUPT_ENABLE 13
> > -#define DMA_D_INTERRUPT_ENABLE 12
> > -#define DMA_C_INTERRUPT_ENABLE 11
> > -#define DMA_B_INTERRUPT_ENABLE 10
> > -#define DMA_A_INTERRUPT_ENABLE 9
> > -#define EEPROM_DONE_INTERRUPT_ENABLE 8
> > -#define VBUS_INTERRUPT_ENABLE 7
> > -#define CONTROL_STATUS_INTERRUPT_ENABLE 6
> > -#define ROOT_PORT_RESET_INTERRUPT_ENABLE 4
> > -#define SUSPEND_REQUEST_INTERRUPT_ENABLE 3
> > -#define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2
> > -#define RESUME_INTERRUPT_ENABLE 1
> > -#define SOF_INTERRUPT_ENABLE 0
> > - __le32 irqstat0;
> > -#define INTA_ASSERTED 12
> > -#define SETUP_PACKET_INTERRUPT 7
> > -#define ENDPOINT_F_INTERRUPT 6
> > -#define ENDPOINT_E_INTERRUPT 5
> > -#define ENDPOINT_D_INTERRUPT 4
> > -#define ENDPOINT_C_INTERRUPT 3
> > -#define ENDPOINT_B_INTERRUPT 2
> > -#define ENDPOINT_A_INTERRUPT 1
> > -#define ENDPOINT_0_INTERRUPT 0
> > - __le32 irqstat1;
> > -#define POWER_STATE_CHANGE_INTERRUPT 27
> > -#define PCI_ARBITER_TIMEOUT_INTERRUPT 26
> > -#define PCI_PARITY_ERROR_INTERRUPT 25
> > -#define PCI_INTA_INTERRUPT 24
> > -#define PCI_PME_INTERRUPT 23
> > -#define PCI_SERR_INTERRUPT 22
> > -#define PCI_PERR_INTERRUPT 21
> > -#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT 20
> > -#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT 19
> > -#define PCI_RETRY_ABORT_INTERRUPT 17
> > -#define PCI_MASTER_CYCLE_DONE_INTERRUPT 16
> > -#define GPIO_INTERRUPT 13
> > -#define DMA_D_INTERRUPT 12
> > -#define DMA_C_INTERRUPT 11
> > -#define DMA_B_INTERRUPT 10
> > -#define DMA_A_INTERRUPT 9
> > -#define EEPROM_DONE_INTERRUPT 8
> > -#define VBUS_INTERRUPT 7
> > -#define CONTROL_STATUS_INTERRUPT 6
> > -#define ROOT_PORT_RESET_INTERRUPT 4
> > -#define SUSPEND_REQUEST_INTERRUPT 3
> > -#define SUSPEND_REQUEST_CHANGE_INTERRUPT 2
> > -#define RESUME_INTERRUPT 1
> > -#define SOF_INTERRUPT 0
> > - /* offset 0x0030 */
> > - __le32 idxaddr;
> > - __le32 idxdata;
> > - __le32 fifoctl;
> > -#define PCI_BASE2_RANGE 16
> > -#define IGNORE_FIFO_AVAILABILITY 3
> > -#define PCI_BASE2_SELECT 2
> > -#define FIFO_CONFIGURATION_SELECT 0
> > - u32 _unused2;
> > - /* offset 0x0040 */
> > - __le32 memaddr;
> > -#define START 28
> > -#define DIRECTION 27
> > -#define FIFO_DIAGNOSTIC_SELECT 24
> > -#define MEMORY_ADDRESS 0
> > - __le32 memdata0;
> > - __le32 memdata1;
> > - u32 _unused3;
> > - /* offset 0x0050 */
> > - __le32 gpioctl;
> > -#define GPIO3_LED_SELECT 12
> > -#define GPIO3_INTERRUPT_ENABLE 11
> > -#define GPIO2_INTERRUPT_ENABLE 10
> > -#define GPIO1_INTERRUPT_ENABLE 9
> > -#define GPIO0_INTERRUPT_ENABLE 8
> > -#define GPIO3_OUTPUT_ENABLE 7
> > -#define GPIO2_OUTPUT_ENABLE 6
> > -#define GPIO1_OUTPUT_ENABLE 5
> > -#define GPIO0_OUTPUT_ENABLE 4
> > -#define GPIO3_DATA 3
> > -#define GPIO2_DATA 2
> > -#define GPIO1_DATA 1
> > -#define GPIO0_DATA 0
> > - __le32 gpiostat;
> > -#define GPIO3_INTERRUPT 3
> > -#define GPIO2_INTERRUPT 2
> > -#define GPIO1_INTERRUPT 1
> > -#define GPIO0_INTERRUPT 0
> > -} __packed;
> > -
> > -/* usb control, BAR0 + 0x0080 */
> > -struct net2280_usb_regs {
> > - /* offset 0x0080 */
> > - __le32 stdrsp;
> > -#define STALL_UNSUPPORTED_REQUESTS 31
> > -#define SET_TEST_MODE 16
> > -#define GET_OTHER_SPEED_CONFIGURATION 15
> > -#define GET_DEVICE_QUALIFIER 14
> > -#define SET_ADDRESS 13
> > -#define ENDPOINT_SET_CLEAR_HALT 12
> > -#define DEVICE_SET_CLEAR_DEVICE_REMOTE_WAKEUP 11
> > -#define GET_STRING_DESCRIPTOR_2 10
> > -#define GET_STRING_DESCRIPTOR_1 9
> > -#define GET_STRING_DESCRIPTOR_0 8
> > -#define GET_SET_INTERFACE 6
> > -#define GET_SET_CONFIGURATION 5
> > -#define GET_CONFIGURATION_DESCRIPTOR 4
> > -#define GET_DEVICE_DESCRIPTOR 3
> > -#define GET_ENDPOINT_STATUS 2
> > -#define GET_INTERFACE_STATUS 1
> > -#define GET_DEVICE_STATUS 0
> > - __le32 prodvendid;
> > -#define PRODUCT_ID 16
> > -#define VENDOR_ID 0
> > - __le32 relnum;
> > - __le32 usbctl;
> > -#define SERIAL_NUMBER_INDEX 16
> > -#define PRODUCT_ID_STRING_ENABLE 13
> > -#define VENDOR_ID_STRING_ENABLE 12
> > -#define USB_ROOT_PORT_WAKEUP_ENABLE 11
> > -#define VBUS_PIN 10
> > -#define TIMED_DISCONNECT 9
> > -#define SUSPEND_IMMEDIATELY 7
> > -#define SELF_POWERED_USB_DEVICE 6
> > -#define REMOTE_WAKEUP_SUPPORT 5
> > -#define PME_POLARITY 4
> > -#define USB_DETECT_ENABLE 3
> > -#define PME_WAKEUP_ENABLE 2
> > -#define DEVICE_REMOTE_WAKEUP_ENABLE 1
> > -#define SELF_POWERED_STATUS 0
> > - /* offset 0x0090 */
> > - __le32 usbstat;
> > -#define HIGH_SPEED 7
> > -#define FULL_SPEED 6
> > -#define GENERATE_RESUME 5
> > -#define GENERATE_DEVICE_REMOTE_WAKEUP 4
> > - __le32 xcvrdiag;
> > -#define FORCE_HIGH_SPEED_MODE 31
> > -#define FORCE_FULL_SPEED_MODE 30
> > -#define USB_TEST_MODE 24
> > -#define LINE_STATE 16
> > -#define TRANSCEIVER_OPERATION_MODE 2
> > -#define TRANSCEIVER_SELECT 1
> > -#define TERMINATION_SELECT 0
> > - __le32 setup0123;
> > - __le32 setup4567;
> > - /* offset 0x0090 */
> > - u32 _unused0;
> > - __le32 ouraddr;
> > -#define FORCE_IMMEDIATE 7
> > -#define OUR_USB_ADDRESS 0
> > - __le32 ourconfig;
> > -} __packed;
> > -
> > -/* pci control, BAR0 + 0x0100 */
> > -struct net2280_pci_regs {
> > - /* offset 0x0100 */
> > - __le32 pcimstctl;
> > -#define PCI_ARBITER_PARK_SELECT 13
> > -#define PCI_MULTI LEVEL_ARBITER 12
> > -#define PCI_RETRY_ABORT_ENABLE 11
> > -#define DMA_MEMORY_WRITE_AND_INVALIDATE_ENABLE 10
> > -#define DMA_READ_MULTIPLE_ENABLE 9
> > -#define DMA_READ_LINE_ENABLE 8
> > -#define PCI_MASTER_COMMAND_SELECT 6
> > -#define MEM_READ_OR_WRITE 0
> > -#define IO_READ_OR_WRITE 1
> > -#define CFG_READ_OR_WRITE 2
> > -#define PCI_MASTER_START 5
> > -#define PCI_MASTER_READ_WRITE 4
> > -#define PCI_MASTER_WRITE 0
> > -#define PCI_MASTER_READ 1
> > -#define PCI_MASTER_BYTE_WRITE_ENABLES 0
> > - __le32 pcimstaddr;
> > - __le32 pcimstdata;
> > - __le32 pcimststat;
> > -#define PCI_ARBITER_CLEAR 2
> > -#define PCI_EXTERNAL_ARBITER 1
> > -#define PCI_HOST_MODE 0
> > -} __packed;
> > -
> > -/* dma control, BAR0 + 0x0180 ... array of four structs like this,
> > - * for channels 0..3. see also struct net2280_dma: descriptor
> > - * that can be loaded into some of these registers.
> > - */
> > -struct net2280_dma_regs { /* [11.7] */
> > - /* offset 0x0180, 0x01a0, 0x01c0, 0x01e0, */
> > - __le32 dmactl;
> > -#define DMA_SCATTER_GATHER_DONE_INTERRUPT_ENABLE 25
> > -#define DMA_CLEAR_COUNT_ENABLE 21
> > -#define DESCRIPTOR_POLLING_RATE 19
> > -#define POLL_CONTINUOUS 0
> > -#define POLL_1_USEC 1
> > -#define POLL_100_USEC 2
> > -#define POLL_1_MSEC 3
> > -#define DMA_VALID_BIT_POLLING_ENABLE 18
> > -#define DMA_VALID_BIT_ENABLE 17
> > -#define DMA_SCATTER_GATHER_ENABLE 16
> > -#define DMA_OUT_AUTO_START_ENABLE 4
> > -#define DMA_PREEMPT_ENABLE 3
> > -#define DMA_FIFO_VALIDATE 2
> > -#define DMA_ENABLE 1
> > -#define DMA_ADDRESS_HOLD 0
> > - __le32 dmastat;
> > -#define DMA_SCATTER_GATHER_DONE_INTERRUPT 25
> > -#define DMA_TRANSACTION_DONE_INTERRUPT 24
> > -#define DMA_ABORT 1
> > -#define DMA_START 0
> > - u32 _unused0[2];
> > - /* offset 0x0190, 0x01b0, 0x01d0, 0x01f0, */
> > - __le32 dmacount;
> > -#define VALID_BIT 31
> > -#define DMA_DIRECTION 30
> > -#define DMA_DONE_INTERRUPT_ENABLE 29
> > -#define END_OF_CHAIN 28
> > -#define DMA_BYTE_COUNT_MASK ((1<<24)-1)
> > -#define DMA_BYTE_COUNT 0
> > - __le32 dmaaddr;
> > - __le32 dmadesc;
> > - u32 _unused1;
> > -} __packed;
> > -
> > -/* dedicated endpoint registers, BAR0 + 0x0200 */
> > -
> > -struct net2280_dep_regs { /* [11.8] */
> > - /* offset 0x0200, 0x0210, 0x220, 0x230, 0x240 */
> > - __le32 dep_cfg;
> > - /* offset 0x0204, 0x0214, 0x224, 0x234, 0x244 */
> > - __le32 dep_rsp;
> > - u32 _unused[2];
> > -} __packed;
> > -
> > -/* configurable endpoint registers, BAR0 + 0x0300 ... array of seven structs
> > - * like this, for ep0 then the configurable endpoints A..F
> > - * ep0 reserved for control; E and F have only 64 bytes of fifo
> > - */
> > -struct net2280_ep_regs { /* [11.9] */
> > - /* offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0 */
> > - __le32 ep_cfg;
> > -#define ENDPOINT_BYTE_COUNT 16
> > -#define ENDPOINT_ENABLE 10
> > -#define ENDPOINT_TYPE 8
> > -#define ENDPOINT_DIRECTION 7
> > -#define ENDPOINT_NUMBER 0
> > - __le32 ep_rsp;
> > -#define SET_NAK_OUT_PACKETS 15
> > -#define SET_EP_HIDE_STATUS_PHASE 14
> > -#define SET_EP_FORCE_CRC_ERROR 13
> > -#define SET_INTERRUPT_MODE 12
> > -#define SET_CONTROL_STATUS_PHASE_HANDSHAKE 11
> > -#define SET_NAK_OUT_PACKETS_MODE 10
> > -#define SET_ENDPOINT_TOGGLE 9
> > -#define SET_ENDPOINT_HALT 8
> > -#define CLEAR_NAK_OUT_PACKETS 7
> > -#define CLEAR_EP_HIDE_STATUS_PHASE 6
> > -#define CLEAR_EP_FORCE_CRC_ERROR 5
> > -#define CLEAR_INTERRUPT_MODE 4
> > -#define CLEAR_CONTROL_STATUS_PHASE_HANDSHAKE 3
> > -#define CLEAR_NAK_OUT_PACKETS_MODE 2
> > -#define CLEAR_ENDPOINT_TOGGLE 1
> > -#define CLEAR_ENDPOINT_HALT 0
> > - __le32 ep_irqenb;
> > -#define SHORT_PACKET_OUT_DONE_INTERRUPT_ENABLE 6
> > -#define SHORT_PACKET_TRANSFERRED_INTERRUPT_ENABLE 5
> > -#define DATA_PACKET_RECEIVED_INTERRUPT_ENABLE 3
> > -#define DATA_PACKET_TRANSMITTED_INTERRUPT_ENABLE 2
> > -#define DATA_OUT_PING_TOKEN_INTERRUPT_ENABLE 1
> > -#define DATA_IN_TOKEN_INTERRUPT_ENABLE 0
> > - __le32 ep_stat;
> > -#define FIFO_VALID_COUNT 24
> > -#define HIGH_BANDWIDTH_OUT_TRANSACTION_PID 22
> > -#define TIMEOUT 21
> > -#define USB_STALL_SENT 20
> > -#define USB_IN_NAK_SENT 19
> > -#define USB_IN_ACK_RCVD 18
> > -#define USB_OUT_PING_NAK_SENT 17
> > -#define USB_OUT_ACK_SENT 16
> > -#define FIFO_OVERFLOW 13
> > -#define FIFO_UNDERFLOW 12
> > -#define FIFO_FULL 11
> > -#define FIFO_EMPTY 10
> > -#define FIFO_FLUSH 9
> > -#define SHORT_PACKET_OUT_DONE_INTERRUPT 6
> > -#define SHORT_PACKET_TRANSFERRED_INTERRUPT 5
> > -#define NAK_OUT_PACKETS 4
> > -#define DATA_PACKET_RECEIVED_INTERRUPT 3
> > -#define DATA_PACKET_TRANSMITTED_INTERRUPT 2
> > -#define DATA_OUT_PING_TOKEN_INTERRUPT 1
> > -#define DATA_IN_TOKEN_INTERRUPT 0
> > - /* offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 */
> > - __le32 ep_avail;
> > - __le32 ep_data;
> > - u32 _unused0[2];
> > -} __packed;
> > -
> > -struct net2280_reg_write {
> > - __le16 port;
> > - __le32 addr;
> > - __le32 val;
> > -} __packed;
> > -
> > -struct net2280_reg_read {
> > - __le16 port;
> > - __le32 addr;
> > -} __packed;
> > -#endif /* NET2280_H */
> > diff --git a/drivers/net/wireless/p54/p54usb.h b/drivers/net/wireless/p54/p54usb.h
> > index d273be7..a5f5f0f 100644
> > --- a/drivers/net/wireless/p54/p54usb.h
> > +++ b/drivers/net/wireless/p54/p54usb.h
> > @@ -16,7 +16,7 @@
> >
> > /* for isl3886 register definitions used on ver 1 devices */
> > #include "p54pci.h"
> > -#include "net2280.h"
> > +#include <linux/usb/net2280.h>
> >
> > /* pci */
> > #define NET2280_BASE 0x10000000
> > @@ -93,6 +93,17 @@ enum net2280_op_type {
> > NET2280_DEV_CFG_U16 = 0x0883
> > };
> >
> > +struct net2280_reg_write {
> > + __le16 port;
> > + __le32 addr;
> > + __le32 val;
> > +} __packed;
> > +
> > +struct net2280_reg_read {
> > + __le16 port;
> > + __le32 addr;
> > +} __packed;
> > +
> > #define P54U_FW_BLOCK 2048
> >
> > #define X2_SIGNATURE "x2 "
> > --
> > 2.1.3
> >
>
>
>
> --
> Ricardo Ribalda
>
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* RE: [PATCH v2] Add support of Cavium Liquidio ethernet adapters
From: Vatsavayi, Raghu @ 2014-12-01 19:57 UTC (permalink / raw)
To: David Miller, f.fainelli@gmail.com
Cc: netdev@vger.kernel.org, Chickles, Derek, Burla, Satananda,
Manlunas, Felix
In-Reply-To: <20141124.160837.1008717214755094566.davem@davemloft.net>
> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Monday, November 24, 2014 1:09 PM
> To: f.fainelli@gmail.com
> Cc: Vatsavayi, Raghu; netdev@vger.kernel.org; Chickles, Derek; Burla,
> Satananda; Manlunas, Felix; Vatsavayi, Raghu
> Subject: Re: [PATCH v2] Add support of Cavium Liquidio ethernet adapters
>
> From: Florian Fainelli <f.fainelli@gmail.com>
> Date: Mon, 24 Nov 2014 13:01:06 -0800
>
> > On 11/23/2014 07:19 PM, Raghu Vatsavayi wrote:
> >> +if LIQUIDIO
> >> +
> >> +config LIQUIDIO_NAPI
> >> + bool "Enable NAPI for LiquidIO"
> >> + default y
> >> + ---help---
> >> + NAPI is a new driver API designed to reduce CPU and interrupt load
> >> + when the driver is receiving lots of packets from the card. You
> >> + would only disable this feature in very specific instances, like
> >> + an application that very rapidly sets up and tears down connections.
> >> +
> >> + If in doubt, say Y.
> >
> > You probably do not want to offer a non-NAPI variant, pretty much all
> > drivers have NAPI built-in now.
>
> +1.
>
> >> +config LIQUIDIO_DEBUG
> >> + int "Debug level for LiquidIO"
> >> + range 0 4
> >> + default 0
> >
> > This should be moved to dynamic_debug/ethtools' msglvl control knob.
>
> +1
Thanks for the comments. We are in the process of removing Kconfig based non-NAPI
selection and enabling NAPI by default. We are also removing separate debug section
and integrating it with ethtool based msglvl debug infrastructure. Additionally we are
planning to clean up non-kerneldoc style comments.
Regards
Raghu
^ permalink raw reply
* RE: [linux-nics] [PATCH] e1000: remove unused variables
From: Fujinaka, Todd @ 2014-12-01 18:56 UTC (permalink / raw)
To: Sudip Mukherjee, Ben Hutchings
Cc: Linux NICS, e1000-devel@lists.sourceforge.net, Hisashi T Fujinaka,
Vick, Matthew, Greg@isotope.jf.intel.com, Kirsher, Jeffrey T,
netdev@vger.kernel.org, Wyborny, Carolyn,
John@isotope.jf.intel.com, linux-kernel@vger.kernel.org
In-Reply-To: <20141201045446.GA3277@sudip-PC>
After discussing this locally, I'd like to NAK it because this could cause regressions to parts that are still in use but we don't have access to. Also, the assignment was necessary in the past for some versions of gcc and since this may be used in embedded systems using older compilers, we should leave it be.
Thanks.
Todd Fujinaka
Software Application Engineer
Networking Division (ND)
Intel Corporation
todd.fujinaka@intel.com
(503) 712-4565
-----Original Message-----
From: linux-nics-bounces@isotope.jf.intel.com [mailto:linux-nics-bounces@isotope.jf.intel.com] On Behalf Of Sudip Mukherjee
Sent: Sunday, November 30, 2014 8:55 PM
To: Ben Hutchings
Cc: Linux NICS; e1000-devel@lists.sourceforge.net; Hisashi T Fujinaka; Vick, Matthew; Greg@isotope.jf.intel.com; Kirsher, Jeffrey T; netdev@vger.kernel.org; Wyborny, Carolyn; John@isotope.jf.intel.com; linux-kernel@vger.kernel.org
Subject: Re: [linux-nics] [PATCH] e1000: remove unused variables
On Sun, Nov 30, 2014 at 01:45:13AM +0000, Ben Hutchings wrote:
> On Wed, 2014-11-26 at 21:59 -0800, Hisashi T Fujinaka wrote:
> > I'm pretty sure those double reads are there for a reason, so most
> > of this I'm going to have to check on Monday. We have a long holiday
> > weekend here in the US.
> [...]
>
> If there were double register reads being replaced with single
> register reads, I'd agree this was likely to introduce a regression.
> But all I see is var = er32(REG) being changed to er32(REG).
no, double register reads are not modified. only the unused variables are removed.
thanks
sudip
>
> Ben.
>
> --
> Ben Hutchings
> The world is coming to an end. Please log off.
_______________________________________________
Linux-nics mailing list
Linux-nics@intel.com
^ permalink raw reply
* Re: [PATCH net-next] test: bpf: expand DIV_KX to DIV_MOD_KX
From: Alexei Starovoitov @ 2014-12-01 17:44 UTC (permalink / raw)
To: Denis Kirjanov, Daniel Borkmann; +Cc: Network Development
On Mon, Dec 1, 2014 at 2:12 AM, Denis Kirjanov <kda@linux-powerpc.org> wrote:
> Expand DIV_KX to use BPF_MOD operation in the
> DIV_KX bpf 'classic' test.
>
> CC: Alexei Starovoitov <ast@plumgrid.com>
> Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
Increases test coverage. Makes sense. Thanks
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
> ---
> lib/test_bpf.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/lib/test_bpf.c b/lib/test_bpf.c
> index 3f167d2..80d78c5 100644
> --- a/lib/test_bpf.c
> +++ b/lib/test_bpf.c
> @@ -124,7 +124,7 @@ static struct bpf_test tests[] = {
> { { 0, 0xfffffffd } }
> },
> {
> - "DIV_KX",
> + "DIV_MOD_KX",
> .u.insns = {
> BPF_STMT(BPF_LD | BPF_IMM, 8),
> BPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 2),
> @@ -134,12 +134,18 @@ static struct bpf_test tests[] = {
> BPF_STMT(BPF_MISC | BPF_TAX, 0),
> BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),
> BPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 0x70000000),
> + BPF_STMT(BPF_MISC | BPF_TAX, 0),
> + BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),
> + BPF_STMT(BPF_ALU | BPF_MOD | BPF_X, 0),
> + BPF_STMT(BPF_MISC | BPF_TAX, 0),
> + BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),
> + BPF_STMT(BPF_ALU | BPF_MOD | BPF_K, 0x70000000),
> BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
> BPF_STMT(BPF_RET | BPF_A, 0)
> },
> CLASSIC | FLAG_NO_DATA,
> { },
> - { { 0, 0x40000001 } }
> + { { 0, 0x20000000 } }
> },
> {
> "AND_OR_LSH_K",
> --
> 1.7.10.4
>
^ permalink raw reply
* Re: [PATCH 1/3] net-PPP: Deletion of unnecessary checks before the function call "kfree"
From: Sergei Shtylyov @ 2014-12-01 17:11 UTC (permalink / raw)
To: SF Markus Elfring, Paul Mackerras, linux-ppp, netdev
Cc: LKML, kernel-janitors, Julia Lawall
In-Reply-To: <547C82A6.2030808@users.sourceforge.net>
On 12/01/2014 06:00 PM, SF Markus Elfring wrote:
>>> diff --git a/drivers/net/ppp/ppp_mppe.c b/drivers/net/ppp/ppp_mppe.c
>>> index 911b216..7e44212 100644
>>> --- a/drivers/net/ppp/ppp_mppe.c
>>> +++ b/drivers/net/ppp/ppp_mppe.c
>>> @@ -238,8 +238,7 @@ static void *mppe_alloc(unsigned char *options, int optlen)
>>> return (void *)state;
>>>
>>> out_free:
>>> - if (state->sha1_digest)
>>> - kfree(state->sha1_digest);
>>> + kfree(state->sha1_digest);
>> Please keep this line aligned to the others.
> Can it be that the previous source code contained unwanted space
> characters at this place?
Yes, it seems so.
> Do you want indentation fixes as a separate update step?
Yes, that would be better to keep it separate.
> Regards,
> Markus
WBR, Sergei
^ permalink raw reply
* Re: Is this 32-bit NCM?
From: Enrico Mioso @ 2014-12-01 16:54 UTC (permalink / raw)
To: Kevin Zhu
Cc: Alex Strizhevsky, Bjørn Mork, Midge Shaojun Tan,
youtux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Eli Britstein
In-Reply-To: <54783F18.1070709-6C2+4RG2qWF0ubjbjo6WXg@public.gmane.org>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2181 bytes --]
Evne to thank you for giving me a test device / shell, I am now modifying
thedriver to be extra debug-ful. I don't know where exactly this will lead if
anywhere, and really have no clue of whatto do next, since all seems normal.
But at least I'll have a clue of what happens.
On Fri, 28 Nov 2014, Kevin Zhu wrote:
==Date: Fri, 28 Nov 2014 10:23:43
==From: Kevin Zhu <Mingying.Zhu-6C2+4RG2qWF0ubjbjo6WXg@public.gmane.org>
==To: Enrico Mioso <mrkiko.rs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
==Cc: Alex Strizhevsky <alexxst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>,
== Midge Shaojun Tan <ShaojunMidge.Tan-6C2+4RG2qWF0ubjbjo6WXg@public.gmane.org>,
== "youtux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <youtux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
== "linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" <linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
== "netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" <netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
== Eli Britstein <Eli.Britstein-6C2+4RG2qWF0ubjbjo6WXg@public.gmane.org>
==Subject: Re: Is this 32-bit NCM?
==
==Yes. The MACs are right. When I started Wireshark, promisc mode was set.
==
==Regards,
==Kevin
==
==On 11/28/2014 05:17 PM, Enrico Mioso wrote:
==> Sorry - resending message to all.
==> Is the MAC right? In my case it was, but ... you never know.
==> And - have you tried the promisc mode, just in case... don't know if this might
==> even be implementedi n the driver, think not, but...
==> I don't know what to think anymore.
==> this ARP packet seems the same as with windows... but might be it's only my
==> impression.
==This email and any files transmitted with it are confidential material. They are intended solely for the use of the designated individual or entity to whom they are addressed. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, use, distribution or copying of this communication is strictly prohibited and may be unlawful.
==
==If you have received this email in error please immediately notify the sender and delete or destroy any copy of this message
==
^ permalink raw reply
* Re: [bisected] xfrm: TCP connection initiating PMTU discovery stalls on v3.12+
From: Wolfgang Walter @ 2014-12-01 16:41 UTC (permalink / raw)
To: Thomas Jarosch; +Cc: netdev, Eric Dumazet
In-Reply-To: <2335530.7OPnEQXbmV@h2o.as.studentenwerk.mhn.de>
Am Montag, 1. Dezember 2014, 14:17:28 schrieb Wolfgang Walter:
> Am Samstag, 29. November 2014, 12:44:07 schrieb Thomas Jarosch:
> > Hello,
> >
> > we're in the process of updating production level machines
> > from kernel 3.4.101 to kernel 3.14.25. On one mail server
> > we noticed that emails destined for an IPSec tunnel sometimes
> > get stuck in the mail queue with TCP timeouts.
> >
> > To make a long story short: When the VPN connection is initially
> > set up or re-newed, the path MTU for the xfrm tunnel is undetermined.
> >
> > As soon as a TCP client starts to send large packets,
> > it triggers path MTU detection. Some middlebox on the
> > way to the final server has a lower MTU and sends back
> > an "ICMP fragmentation needed" packet as normal.
> >
> > With the old kernel, the packet size for the TCP connection inside
> > the xfrm tunnel gets adjusted and all is fine. With kernel v3.12+,
> > the connection stalls completely. Same thing with kernel v3.18-rc6.
>
> We see something similar with real nic (RTL8139). In our case only the first
> tcp-connection which triggers PMTU stalls. Later tcp-connections then work
> fine.
>
> I will revert that patch and see if that fixes the problem.
Reverting the commit fixes the problem here, too.
>
> > We wrote a small tool to mimic postfix's TCP behavior (see attached file).
> > In the end it's a normal TCP client sending large packets.
> > The server side is just "socat - tcp4-listen:667".
> >
> > If you run "socket_client" a second time, the path MTU
> > for the xfrm tunnel is already known and packets flow normal, too.
> >
> >
> > The "evil" commit in question is this one:
> > ---------------------------------------------------------------------
> > commit 8f26fb1c1ed81c33f5d87c5936f4d9d1b4118918
> > Author: Eric Dumazet <edumazet@google.com>
> > Date: Tue Oct 15 12:24:54 2013 -0700
> >
> > tcp: remove the sk_can_gso() check from tcp_set_skb_tso_segs()
> >
> > sk_can_gso() should only be used as a hint in tcp_sendmsg() to build
> > GSO
> >
> > packets in the first place. (As a performance hint)
> >
> > Once we have GSO packets in write queue, we can not decide they are no
> > longer GSO only because flow now uses a route which doesn't handle
> > TSO/GSO.
> >
> > Core networking stack handles the case very well for us, all we need
> > is keeping track of packet counts in MSS terms, regardless of
> > segmentation done later (in GSO or hardware)
> >
> > Right now, if tcp_fragment() splits a GSO packet in two parts,
> > @left and @right, and route changed through a non GSO device,
> > both @left and @right have pcount set to 1, which is wrong,
> > and leads to incorrect packet_count tracking.
> >
> > This problem was added in commit d5ac99a648 ("[TCP]: skb pcount with
> > MTU
> >
> > discovery")
> >
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > Signed-off-by: Neal Cardwell <ncardwell@google.com>
> > Signed-off-by: Yuchung Cheng <ycheng@google.com>
> > Reported-by: Maciej Żenczykowski <maze@google.com>
> > Signed-off-by: David S. Miller <davem@davemloft.net>
> >
> > diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> > index 8fad1c1..d46f214 100644
> > --- a/net/ipv4/tcp_output.c
> > +++ b/net/ipv4/tcp_output.c
> > @@ -989,8 +989,7 @@ static void tcp_set_skb_tso_segs(const struct sock
> > *sk,
> > struct sk_buff *skb, /* Make sure we own this skb before messing
> > gso_size/gso_segs */ WARN_ON_ONCE(skb_cloned(skb));
> >
> > - if (skb->len <= mss_now || !sk_can_gso(sk) ||
> > - skb->ip_summed == CHECKSUM_NONE) {
> > + if (skb->len <= mss_now || skb->ip_summed == CHECKSUM_NONE) {
> >
> > /* Avoid the costly divide in the normal
> >
> > * non-TSO case.
> > */
> >
> > ---------------------------------------------------------------------
> >
> > When I revert it, even kernel v3.18-rc6 starts working.
> > But I doubt this is the root problem, may be just hiding another issue.
> >
> > --- Sample output of socket_client using vanilla v3.12 kernel ---
> > [1417258063 SEND result: 4096, strerror: Success]
> > tcp max seg: res: 0, max_seg: 1370
> > [1417258063 SEND result: 4096, strerror: Success]
> > tcp max seg: res: 0, max_seg: 1370
> > [1417258063 SEND result: 4096, strerror: Success]
> > tcp max seg: res: 0, max_seg: 1370
> > [1417258063 SEND result: 4096, strerror: Success]
> > tcp max seg: res: 0, max_seg: 1370
> > [1417258063 SEND result: 4096, strerror: Success]
> > tcp max seg: res: 0, max_seg: 1338
> > [1417258063 SEND result: 4096, strerror: Success]
> > tcp max seg: res: 0, max_seg: 1338
> > *STUCK*
> > --------------------------------------------------------
> >
> > The "machine" is running on KVM and using "virtio_net" as NIC driver.
> > I've played with the ethtool offload settings:
> >
> > *** eth1 defaults ***
> > Offload parameters for eth1:
> > rx-checksumming: on
> > tx-checksumming: on
> > scatter-gather: on
> > tcp-segmentation-offload: on
> > udp-fragmentation-offload: on
> > generic-segmentation-offload: on
> > generic-receive-offload: on
> > large-receive-offload: off
> >
> > *** eth1 working (no stalls) using vanilla kernel ***
> > Offload parameters for eth1:
> > rx-checksumming: on
> > tx-checksumming: off <-- the magic switch
> > scatter-gather: off
> > tcp-segmentation-offload: off
> > udp-fragmentation-offload: off
> > generic-segmentation-offload: off
> > generic-receive-offload: off
> > large-receive-offload: off
> >
> > When I turn "tx-checksumming" back on, it fails again.
> > Though that is probably also just a side effect.
> >
> > I can provide tcpdumps if needed but they are no real help
> > since you can just see the kernel stops sending TCP packets.
> > (and the outgoing TCP packets are encrypted in ESP packets)
> >
> >
> > Any vague idea what might be the root cause?
> >
> > I also tried reverting commit 4d53eff48b5f03ce67f4f301d6acca1d2145cb7a
> > ("xfrm: Don't queue retransmitted packets if the original is still on the
> > host") but that didn't change the situation. In fact it wasn't even
> > triggered.
> >
> > Please CC: comments. Thanks.
> >
> > Best regards,
> > Thomas
>
> Regards,
Regards,
--
Wolfgang Walter
Studentenwerk München
Anstalt des öffentlichen Rechts
^ 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