* [PATCH 1/5] net-next:asix: PHY_MODE_RTL8211CL should be 0xC
@ 2011-11-14 23:21 Grant Grundler
2011-11-14 23:21 ` [PATCH 2/5] net-next:asix: poll in asix_get_phyid in case phy not ready Grant Grundler
` (3 more replies)
0 siblings, 4 replies; 16+ messages in thread
From: Grant Grundler @ 2011-11-14 23:21 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-kernel, Allan Chou, Freddy Xin, Grant Grundler
Use correct value for rtl phy support.
(rtl phy are in AX88178 devices like NWU220G and USB2-ET1000).
Signed-off-by: Allan Chou <allan@asix.com.tw>
Tested-by: Grant Grundler <grundler@chromium.org>
---
drivers/net/usb/asix.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index e81e22e..873860d 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -163,7 +163,7 @@
#define MARVELL_CTRL_TXDELAY 0x0002
#define MARVELL_CTRL_RXDELAY 0x0080
-#define PHY_MODE_RTL8211CL 0x0004
+#define PHY_MODE_RTL8211CL 0x000C
/* This structure cannot exceed sizeof(unsigned long [5]) AKA 20 bytes */
struct asix_data {
--
1.7.3.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 2/5] net-next:asix: poll in asix_get_phyid in case phy not ready
2011-11-14 23:21 [PATCH 1/5] net-next:asix: PHY_MODE_RTL8211CL should be 0xC Grant Grundler
@ 2011-11-14 23:21 ` Grant Grundler
2011-11-14 23:21 ` [PATCH 3/5] net-next:asix: reduce AX88772 init time by about 2 seconds Grant Grundler
` (2 subsequent siblings)
3 siblings, 0 replies; 16+ messages in thread
From: Grant Grundler @ 2011-11-14 23:21 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-kernel, Allan Chou, Freddy Xin, Grant Grundler
Sometimes the phy isn't ready after reset...poll and pray it will be soon.
Signed-off-by: Freddy Xin <freddy@asix.com.tw>
Signed-off-by: Grant Grundler <grundler@chromium.org>
---
drivers/net/usb/asix.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 873860d..b4675e8 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -652,9 +652,17 @@ static u32 asix_get_phyid(struct usbnet *dev)
{
int phy_reg;
u32 phy_id;
+ int i;
- phy_reg = asix_mdio_read(dev->net, dev->mii.phy_id, MII_PHYSID1);
- if (phy_reg < 0)
+ /* Poll for the rare case the FW or phy isn't ready yet. */
+ for (i = 0; i < 100; i++) {
+ phy_reg = asix_mdio_read(dev->net, dev->mii.phy_id, MII_PHYSID1);
+ if (phy_reg != 0 && phy_reg != 0xFFFF)
+ break;
+ mdelay(1);
+ }
+
+ if (phy_reg <= 0 || phy_reg == 0xFFFF)
return 0;
phy_id = (phy_reg & 0xffff) << 16;
--
1.7.3.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 3/5] net-next:asix: reduce AX88772 init time by about 2 seconds
2011-11-14 23:21 [PATCH 1/5] net-next:asix: PHY_MODE_RTL8211CL should be 0xC Grant Grundler
2011-11-14 23:21 ` [PATCH 2/5] net-next:asix: poll in asix_get_phyid in case phy not ready Grant Grundler
@ 2011-11-14 23:21 ` Grant Grundler
2011-11-14 23:22 ` [PATCH 4/5] net-next:asix: more fixes for ax88178 phy init sequence Grant Grundler
2011-11-14 23:22 ` [PATCH 5/5] net-next:asix: update VERSION and white space changes Grant Grundler
3 siblings, 0 replies; 16+ messages in thread
From: Grant Grundler @ 2011-11-14 23:21 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-kernel, Allan Chou, Freddy Xin, Grant Grundler
ax88772_reset takes about 2 seconds and is called twice.
Once from ax88772_bind() directly and again indirectly from usbnet_open().
Reset the USB FW/Phy enough to blink the LEDs when inserted.
Signed-off-by: Allan Chou <allan@asix.com.tw>
Signed-off-by: Grant Grundler <grundler@chromium.org>
---
drivers/net/usb/asix.c | 30 +++++++++++++++++++++++++-----
1 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index b4675e8..8462be5 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -1083,7 +1083,7 @@ static const struct net_device_ops ax88772_netdev_ops = {
static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
{
- int ret;
+ int ret, embd_phy;
struct asix_data *data = (struct asix_data *)&dev->data;
u8 buf[ETH_ALEN];
u32 phyid;
@@ -1108,16 +1108,36 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
dev->mii.reg_num_mask = 0x1f;
dev->mii.phy_id = asix_get_phy_addr(dev);
- phyid = asix_get_phyid(dev);
- dbg("PHYID=0x%08x", phyid);
-
dev->net->netdev_ops = &ax88772_netdev_ops;
dev->net->ethtool_ops = &ax88772_ethtool_ops;
- ret = ax88772_reset(dev);
+ embd_phy = ((dev->mii.phy_id & 0x1f) == 0x10 ? 1 : 0);
+
+ /* Reset the PHY to normal operation mode */
+ ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, embd_phy, 0, 0, NULL);
+ if (ret < 0) {
+ dbg("Select PHY #1 failed: %d", ret);
+ return ret;
+ }
+
+ ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL);
if (ret < 0)
return ret;
+ msleep(150);
+
+ ret = asix_sw_reset(dev, AX_SWRESET_CLEAR);
+ if (ret < 0)
+ return ret;
+
+ msleep(150);
+
+ ret = asix_sw_reset(dev, embd_phy ? AX_SWRESET_IPRL : AX_SWRESET_PRTE);
+
+ /* Read PHYID register *AFTER* the PHY was reset properly */
+ phyid = asix_get_phyid(dev);
+ dbg("PHYID=0x%08x", phyid);
+
/* Asix framing packs multiple eth frames into a 2K usb bulk transfer */
if (dev->driver_info->flags & FLAG_FRAMING_AX) {
/* hard_mtu is still the default - the device does not support
--
1.7.3.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 4/5] net-next:asix: more fixes for ax88178 phy init sequence
2011-11-14 23:21 [PATCH 1/5] net-next:asix: PHY_MODE_RTL8211CL should be 0xC Grant Grundler
2011-11-14 23:21 ` [PATCH 2/5] net-next:asix: poll in asix_get_phyid in case phy not ready Grant Grundler
2011-11-14 23:21 ` [PATCH 3/5] net-next:asix: reduce AX88772 init time by about 2 seconds Grant Grundler
@ 2011-11-14 23:22 ` Grant Grundler
2011-11-14 23:22 ` [PATCH 5/5] net-next:asix: update VERSION and white space changes Grant Grundler
3 siblings, 0 replies; 16+ messages in thread
From: Grant Grundler @ 2011-11-14 23:22 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-kernel, Allan Chou, Freddy Xin, Grant Grundler
Now works on Samsung Series 5 (chromebook)
Two fixes here:
o use 0x7F mask for phymode
o read phyid *AFTER* phy is powered up (via GPIOs)
Signed-off-by: Allan Chou <allan@asix.com.tw>
Signed-off-by: Grant Grundler <grundler@chromium.org>
---
drivers/net/usb/asix.c | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 8462be5..c07dd26 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -1248,6 +1248,7 @@ static int ax88178_reset(struct usbnet *dev)
__le16 eeprom;
u8 status;
int gpio0 = 0;
+ u32 phyid;
asix_read_cmd(dev, AX_CMD_READ_GPIOS, 0, 0, 1, &status);
dbg("GPIO Status: 0x%04x", status);
@@ -1263,12 +1264,13 @@ static int ax88178_reset(struct usbnet *dev)
data->ledmode = 0;
gpio0 = 1;
} else {
- data->phymode = le16_to_cpu(eeprom) & 7;
+ data->phymode = le16_to_cpu(eeprom) & 0x7F;
data->ledmode = le16_to_cpu(eeprom) >> 8;
gpio0 = (le16_to_cpu(eeprom) & 0x80) ? 0 : 1;
}
dbg("GPIO0: %d, PhyMode: %d", gpio0, data->phymode);
+ /* Power up external GigaPHY through AX88178 GPIO pin */
asix_write_gpio(dev, AX_GPIO_RSE | AX_GPIO_GPO_1 | AX_GPIO_GPO1EN, 40);
if ((le16_to_cpu(eeprom) >> 8) != 1) {
asix_write_gpio(dev, 0x003c, 30);
@@ -1280,6 +1282,13 @@ static int ax88178_reset(struct usbnet *dev)
asix_write_gpio(dev, AX_GPIO_GPO1EN | AX_GPIO_GPO_1, 30);
}
+ /* Read PHYID register *AFTER* powering up PHY */
+ phyid = asix_get_phyid(dev);
+ dbg("PHYID=0x%08x", phyid);
+
+ /* Set AX88178 to enable MII/GMII/RGMII interface for external PHY */
+ asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, 0, 0, 0, NULL);
+
asix_sw_reset(dev, 0);
msleep(150);
@@ -1424,7 +1433,6 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
{
int ret;
u8 buf[ETH_ALEN];
- u32 phyid;
struct asix_data *data = (struct asix_data *)&dev->data;
data->eeprom_len = AX88772_EEPROM_LEN;
@@ -1451,12 +1459,12 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
dev->net->netdev_ops = &ax88178_netdev_ops;
dev->net->ethtool_ops = &ax88178_ethtool_ops;
- phyid = asix_get_phyid(dev);
- dbg("PHYID=0x%08x", phyid);
+ /* Blink LEDS so users know driver saw dongle */
+ ax88178_sw_reset(dev, 0);
+ msleep(150);
- ret = ax88178_reset(dev);
- if (ret < 0)
- return ret;
+ asix_sw_reset(dev, AX_SWRESET_PRL | AX_SWRESET_IPPD);
+ msleep(150);
/* Asix framing packs multiple eth frames into a 2K usb bulk transfer */
if (dev->driver_info->flags & FLAG_FRAMING_AX) {
--
1.7.3.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 5/5] net-next:asix: update VERSION and white space changes
2011-11-14 23:21 [PATCH 1/5] net-next:asix: PHY_MODE_RTL8211CL should be 0xC Grant Grundler
` (2 preceding siblings ...)
2011-11-14 23:22 ` [PATCH 4/5] net-next:asix: more fixes for ax88178 phy init sequence Grant Grundler
@ 2011-11-14 23:22 ` Grant Grundler
2011-11-14 23:42 ` David Miller
3 siblings, 1 reply; 16+ messages in thread
From: Grant Grundler @ 2011-11-14 23:22 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-kernel, Allan Chou, Freddy Xin, Grant Grundler
No functional changes. Three things targeted:
o update VERSION to reflect previous changes.
o fix up white space/formatting of some lines
o define 150 to be AX_SWRESET_MDELAY (self documenting code)
Signed-off-by: Grant Grundler <grundler@chromium.org>
---
drivers/net/usb/asix.c | 46 +++++++++++++++++++++-------------------------
1 files changed, 21 insertions(+), 25 deletions(-)
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index c07dd26..29598dc 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -36,7 +36,7 @@
#include <linux/usb/usbnet.h>
#include <linux/slab.h>
-#define DRIVER_VERSION "26-Sep-2011"
+#define DRIVER_VERSION "08-Nov-2011"
#define DRIVER_NAME "asix"
/* ASIX AX8817X based USB 2.0 Ethernet Devices */
@@ -94,6 +94,8 @@
#define AX_SWRESET_IPRL 0x20
#define AX_SWRESET_IPPD 0x40
+#define AX_SWRESET_MDELAY 150
+
#define AX88772_IPG0_DEFAULT 0x15
#define AX88772_IPG1_DEFAULT 0x0c
#define AX88772_IPG2_DEFAULT 0x12
@@ -494,9 +496,9 @@ static int asix_sw_reset(struct usbnet *dev, u8 flags)
{
int ret;
- ret = asix_write_cmd(dev, AX_CMD_SW_RESET, flags, 0, 0, NULL);
+ ret = asix_write_cmd(dev, AX_CMD_SW_RESET, flags, 0, 0, NULL);
if (ret < 0)
- netdev_err(dev->net, "Failed to send software reset: %02x\n", ret);
+ netdev_err(dev->net, "Failed to send SW_RESET: %02x\n", ret);
return ret;
}
@@ -540,7 +542,6 @@ static u16 asix_read_medium_status(struct usbnet *dev)
}
return le16_to_cpu(v);
-
}
static int asix_write_medium_mode(struct usbnet *dev, u16 mode)
@@ -792,9 +793,9 @@ static int asix_set_mac_address(struct net_device *net, void *p)
return 0;
}
-/* We need to override some ethtool_ops so we require our
- own structure so we don't interfere with other usbnet
- devices that may be connected at the same time. */
+/* We override some ethtool_ops to access per device data.
+ * Multiple usbnet devices may be connected at the same time.
+ */
static const struct ethtool_ops ax88172_ethtool_ops = {
.get_drvinfo = asix_get_drvinfo,
.get_link = asix_get_link,
@@ -994,25 +995,20 @@ static int ax88772_reset(struct usbnet *dev)
if (ret < 0)
goto out;
- msleep(150);
+ msleep(AX_SWRESET_MDELAY);
ret = asix_sw_reset(dev, AX_SWRESET_CLEAR);
if (ret < 0)
goto out;
- msleep(150);
+ msleep(AX_SWRESET_MDELAY);
- if (embd_phy) {
- ret = asix_sw_reset(dev, AX_SWRESET_IPRL);
- if (ret < 0)
- goto out;
- } else {
- ret = asix_sw_reset(dev, AX_SWRESET_PRTE);
- if (ret < 0)
- goto out;
- }
+ ret = asix_sw_reset(dev, embd_phy ? AX_SWRESET_IPRL : AX_SWRESET_PRTE);
+ if (ret < 0)
+ goto out;
+
+ msleep(AX_SWRESET_MDELAY);
- msleep(150);
rx_ctl = asix_read_rx_ctl(dev);
dbg("RX_CTL is 0x%04x after software reset", rx_ctl);
ret = asix_write_rx_ctl(dev, 0x0000);
@@ -1026,13 +1022,13 @@ static int ax88772_reset(struct usbnet *dev)
if (ret < 0)
goto out;
- msleep(150);
+ msleep(AX_SWRESET_MDELAY);
ret = asix_sw_reset(dev, AX_SWRESET_IPRL | AX_SWRESET_PRL);
if (ret < 0)
goto out;
- msleep(150);
+ msleep(AX_SWRESET_MDELAY);
asix_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
asix_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
@@ -1290,10 +1286,10 @@ static int ax88178_reset(struct usbnet *dev)
asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, 0, 0, 0, NULL);
asix_sw_reset(dev, 0);
- msleep(150);
+ msleep(AX_SWRESET_MDELAY);
asix_sw_reset(dev, AX_SWRESET_PRL | AX_SWRESET_IPPD);
- msleep(150);
+ msleep(AX_SWRESET_MDELAY);
asix_write_rx_ctl(dev, 0);
@@ -1672,13 +1668,13 @@ static struct usb_driver asix_driver = {
static int __init asix_init(void)
{
- return usb_register(&asix_driver);
+ return usb_register(&asix_driver);
}
module_init(asix_init);
static void __exit asix_exit(void)
{
- usb_deregister(&asix_driver);
+ usb_deregister(&asix_driver);
}
module_exit(asix_exit);
--
1.7.3.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 5/5] net-next:asix: update VERSION and white space changes
2011-11-14 23:22 ` [PATCH 5/5] net-next:asix: update VERSION and white space changes Grant Grundler
@ 2011-11-14 23:42 ` David Miller
2011-11-15 0:39 ` Grant Grundler
2011-11-15 0:54 ` Grant Grundler
0 siblings, 2 replies; 16+ messages in thread
From: David Miller @ 2011-11-14 23:42 UTC (permalink / raw)
To: grundler; +Cc: netdev, linux-kernel, allan, freddy
From: Grant Grundler <grundler@chromium.org>
Date: Mon, 14 Nov 2011 15:22:01 -0800
> No functional changes. Three things targeted:
> o update VERSION to reflect previous changes.
> o fix up white space/formatting of some lines
> o define 150 to be AX_SWRESET_MDELAY (self documenting code)
>
> Signed-off-by: Grant Grundler <grundler@chromium.org>
Why have such a wonderful set of real bug fixes that I can apply right
now and send off to Linus's tree, only to sabotage it with whitespace
changes at the end which are no appropriate?
Please, just submit this without the whitespace and other cleanup
stuff. Restrict it to real bug fixes, and I'll push it around.
The whitespace and other bits can be submitted for net-next afterwards.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 5/5] net-next:asix: update VERSION and white space changes
2011-11-14 23:42 ` David Miller
@ 2011-11-15 0:39 ` Grant Grundler
2011-11-15 0:54 ` Grant Grundler
1 sibling, 0 replies; 16+ messages in thread
From: Grant Grundler @ 2011-11-15 0:39 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-kernel, allan, freddy
On Mon, Nov 14, 2011 at 3:42 PM, David Miller <davem@davemloft.net> wrote:
> From: Grant Grundler <grundler@chromium.org>
> Date: Mon, 14 Nov 2011 15:22:01 -0800
>
>> No functional changes. Three things targeted:
>> o update VERSION to reflect previous changes.
>> o fix up white space/formatting of some lines
>> o define 150 to be AX_SWRESET_MDELAY (self documenting code)
>>
>> Signed-off-by: Grant Grundler <grundler@chromium.org>
>
> Why have such a wonderful set of real bug fixes that I can apply right
> now and send off to Linus's tree, only to sabotage it with whitespace
> changes at the end which are no appropriate?
>
> Please, just submit this without the whitespace and other cleanup
> stuff. Restrict it to real bug fixes, and I'll push it around.
No Problem! :)
I wasn't expecting this to go to linus immediately but it makes that it should.
> The whitespace and other bits can be submitted for net-next afterwards.
Will do.
cheers,
grant
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 5/5] net-next:asix: update VERSION and white space changes
2011-11-14 23:42 ` David Miller
2011-11-15 0:39 ` Grant Grundler
@ 2011-11-15 0:54 ` Grant Grundler
2011-11-15 2:32 ` David Miller
1 sibling, 1 reply; 16+ messages in thread
From: Grant Grundler @ 2011-11-15 0:54 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-kernel, allan, freddy
On Mon, Nov 14, 2011 at 3:42 PM, David Miller <davem@davemloft.net> wrote:
...
> Please, just submit this without the whitespace and other cleanup
> stuff. Restrict it to real bug fixes, and I'll push it around.
I just sent a "v2" of 5/5 patch which only has the VERSION change. Is
that sufficient or should I resend all 5?
thanks!
grant
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 5/5] net-next:asix: update VERSION and white space changes
2011-11-15 0:54 ` Grant Grundler
@ 2011-11-15 2:32 ` David Miller
2011-11-15 2:41 ` David Miller
0 siblings, 1 reply; 16+ messages in thread
From: David Miller @ 2011-11-15 2:32 UTC (permalink / raw)
To: grundler; +Cc: netdev, linux-kernel, allan, freddy
From: Grant Grundler <grundler@chromium.org>
Date: Mon, 14 Nov 2011 16:54:35 -0800
> On Mon, Nov 14, 2011 at 3:42 PM, David Miller <davem@davemloft.net> wrote:
> ...
>> Please, just submit this without the whitespace and other cleanup
>> stuff. Restrict it to real bug fixes, and I'll push it around.
>
> I just sent a "v2" of 5/5 patch which only has the VERSION change. Is
> that sufficient or should I resend all 5?
Just respinning #5 is fine, thanks.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 5/5] net-next:asix: update VERSION and white space changes
2011-11-15 2:32 ` David Miller
@ 2011-11-15 2:41 ` David Miller
2011-11-15 2:45 ` David Miller
0 siblings, 1 reply; 16+ messages in thread
From: David Miller @ 2011-11-15 2:41 UTC (permalink / raw)
To: grundler; +Cc: netdev, linux-kernel, allan, freddy
From: David Miller <davem@davemloft.net>
Date: Mon, 14 Nov 2011 21:32:55 -0500 (EST)
> From: Grant Grundler <grundler@chromium.org>
> Date: Mon, 14 Nov 2011 16:54:35 -0800
>
>> On Mon, Nov 14, 2011 at 3:42 PM, David Miller <davem@davemloft.net> wrote:
>> ...
>>> Please, just submit this without the whitespace and other cleanup
>>> stuff. Restrict it to real bug fixes, and I'll push it around.
>>
>> I just sent a "v2" of 5/5 patch which only has the VERSION change. Is
>> that sufficient or should I resend all 5?
>
> Just respinning #5 is fine, thanks.
But the fact that the other bits don't even compile... that's not fine.
drivers/net/usb/asix.c: In function ‘ax88178_bind’:
drivers/net/usb/asix.c:1463:2: error: implicit declaration of function ‘ax88178_sw_reset’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
[davem@boricha net]$ git grep ax88178_sw_reset
drivers/net/usb/asix.c: ax88178_sw_reset(dev, 0);
Come on man... are you kidding me?
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 5/5] net-next:asix: update VERSION and white space changes
2011-11-15 2:41 ` David Miller
@ 2011-11-15 2:45 ` David Miller
2011-11-15 15:19 ` Mark Lord
2011-11-15 15:58 ` Grant Grundler
0 siblings, 2 replies; 16+ messages in thread
From: David Miller @ 2011-11-15 2:45 UTC (permalink / raw)
To: grundler; +Cc: netdev, linux-kernel, allan, freddy, kernel
From: David Miller <davem@davemloft.net>
Date: Mon, 14 Nov 2011 21:41:51 -0500 (EST)
> Come on man... are you kidding me?
Want to know what really pisses me off about this?
All of Mark Lord's hard work to bring the entire vendor driver over
was thrown out.
And it was thrown out in favor of this! Code that doesn't even
compile.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 5/5] net-next:asix: update VERSION and white space changes
2011-11-15 2:45 ` David Miller
@ 2011-11-15 15:19 ` Mark Lord
2011-11-15 21:41 ` David Miller
2011-11-15 15:58 ` Grant Grundler
1 sibling, 1 reply; 16+ messages in thread
From: Mark Lord @ 2011-11-15 15:19 UTC (permalink / raw)
To: David Miller; +Cc: grundler, netdev, linux-kernel, allan, freddy
On 11-11-14 09:45 PM, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Mon, 14 Nov 2011 21:41:51 -0500 (EST)
>
>> Come on man... are you kidding me?
>
> Want to know what really pisses me off about this?
>
> All of Mark Lord's hard work to bring the entire vendor driver over
> was thrown out.
Well, ASIX and I appear to be back on track again.
So once the dust settles in net-dev with Grant's patches,
I will take over development of the asix driver,
and start sending you (Dave) patches to merge the
rest of the vendor's driver code.
With luck, it might all make it in there in time for the next (3.3) merge.
Cheers
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 5/5] net-next:asix: update VERSION and white space changes
2011-11-15 2:45 ` David Miller
2011-11-15 15:19 ` Mark Lord
@ 2011-11-15 15:58 ` Grant Grundler
1 sibling, 0 replies; 16+ messages in thread
From: Grant Grundler @ 2011-11-15 15:58 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-kernel, allan, freddy, kernel
On Mon, Nov 14, 2011 at 6:45 PM, David Miller <davem@davemloft.net> wrote:
> From: David Miller <davem@davemloft.net>
> Date: Mon, 14 Nov 2011 21:41:51 -0500 (EST)
>
>> Come on man... are you kidding me?
Dave,
my apologies. That's obviously my fail.
The problem is I can't test your git tree on my systems...but I should
have at least compile tested it. Or just submitted the changes
straight from chromium.org tree. *sigh*
> Want to know what really pisses me off about this?
>
> All of Mark Lord's hard work to bring the entire vendor driver over
> was thrown out.
Not entirely correct as Mark pointed out. I was able to convince ASIX
they should be working with Mark and they committed to doing so.
> And it was thrown out in favor of this! Code that doesn't even
> compile.
*sigh* sorry...I'll resubmit the entire mess and compile test first. /o\
thanks for your patience,
grant
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 3/5] net-next:asix: reduce AX88772 init time by about 2 seconds
2011-11-15 17:12 [PATCH 1/5] net-next:asix:PHY_MODE_RTL8211CL should be 0xC Grant Grundler
@ 2011-11-15 17:12 ` Grant Grundler
2011-11-15 21:41 ` David Miller
0 siblings, 1 reply; 16+ messages in thread
From: Grant Grundler @ 2011-11-15 17:12 UTC (permalink / raw)
To: davem
Cc: netdev, linux-kernel, Allan Chou, Freddy Xin, Grant Grundler,
Grant Grundler
From: Grant Grundler <grundler@google.com>
ax88772_reset takes about 2 seconds and is called twice.
Once from ax88772_bind() directly and again indirectly from usbnet_open().
Reset the USB FW/Phy enough to blink the LEDs when inserted.
Signed-off-by: Allan Chou <allan@asix.com.tw>
Signed-off-by: Grant Grundler <grundler@chromium.org>
---
drivers/net/usb/asix.c | 30 +++++++++++++++++++++++++-----
1 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index b4675e8..8462be5 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -1083,7 +1083,7 @@ static const struct net_device_ops ax88772_netdev_ops = {
static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
{
- int ret;
+ int ret, embd_phy;
struct asix_data *data = (struct asix_data *)&dev->data;
u8 buf[ETH_ALEN];
u32 phyid;
@@ -1108,16 +1108,36 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
dev->mii.reg_num_mask = 0x1f;
dev->mii.phy_id = asix_get_phy_addr(dev);
- phyid = asix_get_phyid(dev);
- dbg("PHYID=0x%08x", phyid);
-
dev->net->netdev_ops = &ax88772_netdev_ops;
dev->net->ethtool_ops = &ax88772_ethtool_ops;
- ret = ax88772_reset(dev);
+ embd_phy = ((dev->mii.phy_id & 0x1f) == 0x10 ? 1 : 0);
+
+ /* Reset the PHY to normal operation mode */
+ ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, embd_phy, 0, 0, NULL);
+ if (ret < 0) {
+ dbg("Select PHY #1 failed: %d", ret);
+ return ret;
+ }
+
+ ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL);
if (ret < 0)
return ret;
+ msleep(150);
+
+ ret = asix_sw_reset(dev, AX_SWRESET_CLEAR);
+ if (ret < 0)
+ return ret;
+
+ msleep(150);
+
+ ret = asix_sw_reset(dev, embd_phy ? AX_SWRESET_IPRL : AX_SWRESET_PRTE);
+
+ /* Read PHYID register *AFTER* the PHY was reset properly */
+ phyid = asix_get_phyid(dev);
+ dbg("PHYID=0x%08x", phyid);
+
/* Asix framing packs multiple eth frames into a 2K usb bulk transfer */
if (dev->driver_info->flags & FLAG_FRAMING_AX) {
/* hard_mtu is still the default - the device does not support
--
1.7.3.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 5/5] net-next:asix: update VERSION and white space changes
2011-11-15 15:19 ` Mark Lord
@ 2011-11-15 21:41 ` David Miller
0 siblings, 0 replies; 16+ messages in thread
From: David Miller @ 2011-11-15 21:41 UTC (permalink / raw)
To: kernel; +Cc: grundler, netdev, linux-kernel, allan, freddy
From: Mark Lord <kernel@teksavvy.com>
Date: Tue, 15 Nov 2011 10:19:59 -0500
> On 11-11-14 09:45 PM, David Miller wrote:
>> From: David Miller <davem@davemloft.net>
>> Date: Mon, 14 Nov 2011 21:41:51 -0500 (EST)
>>
>>> Come on man... are you kidding me?
>>
>> Want to know what really pisses me off about this?
>>
>> All of Mark Lord's hard work to bring the entire vendor driver over
>> was thrown out.
>
>
> Well, ASIX and I appear to be back on track again.
That's great news.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/5] net-next:asix: reduce AX88772 init time by about 2 seconds
2011-11-15 17:12 ` [PATCH 3/5] net-next:asix: reduce AX88772 init time by about 2 seconds Grant Grundler
@ 2011-11-15 21:41 ` David Miller
0 siblings, 0 replies; 16+ messages in thread
From: David Miller @ 2011-11-15 21:41 UTC (permalink / raw)
To: grundler; +Cc: netdev, linux-kernel, allan, freddy, grundler
From: Grant Grundler <grundler@chromium.org>
Date: Tue, 15 Nov 2011 09:12:41 -0800
> From: Grant Grundler <grundler@google.com>
>
> ax88772_reset takes about 2 seconds and is called twice.
> Once from ax88772_bind() directly and again indirectly from usbnet_open().
> Reset the USB FW/Phy enough to blink the LEDs when inserted.
>
> Signed-off-by: Allan Chou <allan@asix.com.tw>
> Signed-off-by: Grant Grundler <grundler@chromium.org>
Applied.
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2011-11-15 21:41 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-14 23:21 [PATCH 1/5] net-next:asix: PHY_MODE_RTL8211CL should be 0xC Grant Grundler
2011-11-14 23:21 ` [PATCH 2/5] net-next:asix: poll in asix_get_phyid in case phy not ready Grant Grundler
2011-11-14 23:21 ` [PATCH 3/5] net-next:asix: reduce AX88772 init time by about 2 seconds Grant Grundler
2011-11-14 23:22 ` [PATCH 4/5] net-next:asix: more fixes for ax88178 phy init sequence Grant Grundler
2011-11-14 23:22 ` [PATCH 5/5] net-next:asix: update VERSION and white space changes Grant Grundler
2011-11-14 23:42 ` David Miller
2011-11-15 0:39 ` Grant Grundler
2011-11-15 0:54 ` Grant Grundler
2011-11-15 2:32 ` David Miller
2011-11-15 2:41 ` David Miller
2011-11-15 2:45 ` David Miller
2011-11-15 15:19 ` Mark Lord
2011-11-15 21:41 ` David Miller
2011-11-15 15:58 ` Grant Grundler
-- strict thread matches above, loose matches on Subject: below --
2011-11-15 17:12 [PATCH 1/5] net-next:asix:PHY_MODE_RTL8211CL should be 0xC Grant Grundler
2011-11-15 17:12 ` [PATCH 3/5] net-next:asix: reduce AX88772 init time by about 2 seconds Grant Grundler
2011-11-15 21:41 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).