Commit cea6c8ce2327cfb41a13a8b8655e74dd18c2e6b7

Authored by Alban Bedel
Committed by Marek Vasut
1 parent cbe7706ab8

net: asix: Fix ASIX 88772B with driver model

Commit 147271209a9d ("net: asix: fix operation without eeprom")
added a special handling for ASIX 88772B that enable another
type of header. This break the driver in DM mode as the extra handling
needed in the receive path is missing.

However this new header mode is not required and only seems to
increase the code complexity, so this patch revert this part of
commit 147271209a9d.

This also reverts commit 41d1258aceb45b45f9e68f67a9c40f0afbc09dc9
("net: asix: Fix AX88772B when used with DriverModel") of late.

Fixes: 147271209a9d ("net: asix: fix operation without eeprom")

Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>

Showing 1 changed file with 3 additions and 24 deletions Side-by-side Diff

drivers/usb/eth/asix.c
... ... @@ -67,11 +67,8 @@
67 67 AX_MEDIUM_AC | AX_MEDIUM_RE)
68 68  
69 69 /* AX88772 & AX88178 RX_CTL values */
70   -#define AX_RX_CTL_RH2M 0x0200 /* 32-bit aligned RX IP header */
71   -#define AX_RX_CTL_RH1M 0x0100 /* Enable RX header format type 1 */
72   -#define AX_RX_CTL_SO 0x0080
73   -#define AX_RX_CTL_AB 0x0008
74   -#define AX_RX_HEADER_DEFAULT (AX_RX_CTL_RH1M | AX_RX_CTL_RH2M)
  70 +#define AX_RX_CTL_SO 0x0080
  71 +#define AX_RX_CTL_AB 0x0008
75 72  
76 73 #define AX_DEFAULT_RX_CTL \
77 74 (AX_RX_CTL_SO | AX_RX_CTL_AB)
... ... @@ -98,8 +95,6 @@
98 95 #define FLAG_TYPE_AX88772B (1U << 2)
99 96 #define FLAG_EEPROM_MAC (1U << 3) /* initial mac address in eeprom */
100 97  
101   -#define ASIX_USB_VENDOR_ID 0x0b95
102   -#define AX88772B_USB_PRODUCT_ID 0x772b
103 98  
104 99 /* driver private */
105 100 struct asix_private {
106 101  
... ... @@ -431,15 +426,10 @@
431 426 int timeout = 0;
432 427 #define TIMEOUT_RESOLUTION 50 /* ms */
433 428 int link_detected;
434   - u32 ctl = AX_DEFAULT_RX_CTL;
435 429  
436 430 debug("** %s()\n", __func__);
437 431  
438   - if ((dev->pusb_dev->descriptor.idVendor == ASIX_USB_VENDOR_ID) &&
439   - (dev->pusb_dev->descriptor.idProduct == AX88772B_USB_PRODUCT_ID))
440   - ctl |= AX_RX_HEADER_DEFAULT;
441   -
442   - if (asix_write_rx_ctl(dev, ctl) < 0)
  432 + if (asix_write_rx_ctl(dev, AX_DEFAULT_RX_CTL) < 0)
443 433 goto out_err;
444 434  
445 435 if (asix_write_hwaddr_common(dev, enetaddr) < 0)
... ... @@ -572,12 +562,6 @@
572 562 return -1;
573 563 }
574 564  
575   - if ((dev->pusb_dev->descriptor.idVendor ==
576   - ASIX_USB_VENDOR_ID) &&
577   - (dev->pusb_dev->descriptor.idProduct ==
578   - AX88772B_USB_PRODUCT_ID))
579   - buf_ptr += 2;
580   -
581 565 /* Notify net stack */
582 566 net_process_received_packet(buf_ptr + sizeof(packet_len),
583 567 packet_len);
... ... @@ -819,11 +803,6 @@
819 803 }
820 804  
821 805 *packetp = ptr + sizeof(packet_len);
822   -
823   - if ((ueth->pusb_dev->descriptor.idVendor == ASIX_USB_VENDOR_ID) &&
824   - (ueth->pusb_dev->descriptor.idProduct == AX88772B_USB_PRODUCT_ID))
825   - *packetp += 2;
826   -
827 806 return packet_len;
828 807  
829 808 err: