Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sys/dev/usb/if_axen.c



hi,

On 2023/11/13 12:29, Makoto Fujiwara wrote:
> Hi,
> I have following device:
>   -----------------
>   axen0 at uhub3 port 1
>   axen0: ASIX (0x0b95) AX88179A (0x1790), rev 2.10/2.00, addr 3
>   axen0: AX88179
>   ukphy0 at axen0 phy 3: OUI 0x00e038, model 0x0006, rev. 1
>   ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, auto
>   axen0: Ethernet address ....
>   -----------------
> And running 10.99.10,
> it emits following lines
> 
>   Nov 13 20:24:54 beebox-03 /netbsd: [ 154.8236912] axen0: autoconfiguration error: invalid buffer(pkt#1), continue
> 
> I put simple checking line as:
> 
> -----------
> diff --git a/sys/dev/usb/if_axen.c b/sys/dev/usb/if_axen.c
> index 423a87e5c541..6215db354c90 100644
> --- a/sys/dev/usb/if_axen.c
> +++ b/sys/dev/usb/if_axen.c
> @@ -793,6 +793,8 @@ axen_uno_rx_loop(struct usbnet *un, struct usbnet_chain *c, uint32_t total_len)
>  		if ((buf[0] != 0xee) || (buf[1] != 0xee)) {
>  			aprint_error_dev(un->un_dev,
>  			    "invalid buffer(pkt#%d), continue\n", pkt_count);
> +			aprint_error_dev(un->un_dev,
> +			    "%04d %02x %02x\n", __LINE__, buf[0], buf[1]);
>  			if_statadd(ifp, if_ierrors, pkt_count);
>  			return;
>  		}
> -----------
> 
> and then the lines show:
> 
> Nov 13 20:25:03 beebox-03 /netbsd: [ 163.6740410] axen0: autoconfiguration error: invalid buffer(pkt#1), continue
> Nov 13 20:25:03 beebox-03 /netbsd: [ 163.6740410] axen0: autoconfiguration error: 0797 00 08
> 
> so buf[0]:buf[1] expected 0xeeee is 0x0008.
> 
> I've compared to openbsd: if_axen.c 
>    https://raw.githubusercontent.com/openbsd/src/master/sys/dev/usb/if_axen.c
> to N, and there are so many differencies.
> 
> Does this (N) if_axen.c works on any installation ?

I've compared with freebsd.
https://cgit.freebsd.org/src/plain/sys/dev/usb/net/if_axge.c says:

> 	if ((sc->sc_flags & AXGE_FLAG_179A) != 0) {
> 		/*
> 		 * 179A chip has two firmware modes that each use different
> 		 * transfer layouts for Ethernet over USB. The newer fw mode has
> 		 * larger rx packet headers which seem to
> 		 * accomodate for ethernet frames up to 9K length and a VLAN
> 		 * field for hardware tagging, but is not backward compatible
> 		 * with 178A/179 bulk transfer code due to the change in size
> 		 * and field alignments. The other fw mode uses the same packet
> 		 * headers as the older 178A/179 chips, which this driver uses.
> 		 *
> 		 * As we do not currently have VLAN hw tagging or jumbo support
> 		 * in this driver anyway, we're ok forcing 179A into its compat
> 		 * mode by default.
> 		 */
> 		axge_write_cmd_1(sc, AXGE_FW_MODE, AXGE_FW_MODE_178A179, 0);
> 	}

This might help us?
I don't have 179A, I cannot try it out.

> 
> Also, I've prepared GENERIC-axen with following conf:
>   -------
>   include         "arch/amd64/conf/GENERIC"
>   options         AXEN_DEBUG
>   options         MSGBUFSIZE=131072
>   -------
> but No debug lines appears, please let me know what is wrong,

Please raise axendebug in ddb or crash.

# echo 'w/l axendebug 1' | crash -w

> thanks


Home | Main Index | Thread Index | Old Index