]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/net/asix.c
[PATCH] remove many unneeded #includes of sched.h
[linux-2.6-omap-h63xx.git] / drivers / usb / net / asix.c
index 95e682e2c9d658892f6995da890e51243a333c69..bd357e178e557548b464ed4187055b3be54970d3 100644 (file)
@@ -25,7 +25,6 @@
 
 #include <linux/module.h>
 #include <linux/kmod.h>
-#include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
@@ -898,7 +897,7 @@ static int ax88772_link_reset(struct usbnet *dev)
 
 static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
 {
-       int ret;
+       int ret, embd_phy;
        void *buf;
        u16 rx_ctl;
        struct asix_data *data = (struct asix_data *)&dev->data;
@@ -919,13 +918,15 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
                        AX_GPIO_RSE | AX_GPIO_GPO_2 | AX_GPIO_GPO2EN, 5)) < 0)
                goto out2;
 
+       /* 0x10 is the phy id of the embedded 10/100 ethernet phy */
+       embd_phy = ((asix_get_phy_addr(dev) & 0x1f) == 0x10 ? 1 : 0);
        if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT,
-                               0x0000, 0, 0, buf)) < 0) {
+                               embd_phy, 0, 0, buf)) < 0) {
                dbg("Select PHY #1 failed: %d", ret);
                goto out2;
        }
 
-       if ((ret = asix_sw_reset(dev, AX_SWRESET_IPPD)) < 0)
+       if ((ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL)) < 0)
                goto out2;
 
        msleep(150);
@@ -933,8 +934,14 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
                goto out2;
 
        msleep(150);
-       if ((ret = asix_sw_reset(dev, AX_SWRESET_IPRL | AX_SWRESET_PRL)) < 0)
-               goto out2;
+       if (embd_phy) {
+               if ((ret = asix_sw_reset(dev, AX_SWRESET_IPRL)) < 0)
+                       goto out2;
+       }
+       else {
+               if ((ret = asix_sw_reset(dev, AX_SWRESET_PRTE)) < 0)
+                       goto out2;
+       }
 
        msleep(150);
        rx_ctl = asix_read_rx_ctl(dev);
@@ -1441,6 +1448,10 @@ static const struct usb_device_id        products [] = {
        // Linksys USB1000
        USB_DEVICE (0x1737, 0x0039),
        .driver_info = (unsigned long) &ax88178_info,
+}, {
+       // IO-DATA ETG-US2
+       USB_DEVICE (0x04bb, 0x0930),
+       .driver_info = (unsigned long) &ax88178_info,
 },
        { },            // END
 };