Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Aug 2016 16:48:53 +0800
From:      Sepherosa Ziehau <sepherosa@gmail.com>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        Pyun YongHyeon <yongari@freebsd.org>, src-committers@freebsd.org,  svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r304439 - head/sys/dev/usb/net
Message-ID:  <CAMOc5cxOJQr5ScoWvzfvhNpk-OdCrh%2Bi%2B1jv4eo4-1QDWzZ5Jg@mail.gmail.com>
In-Reply-To: <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org>
References:  <201608190050.u7J0oWkW043171@repo.freebsd.org> <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Aug 19, 2016 at 4:50 PM, Hans Petter Selasky <hps@selasky.org> wrote:
> On 08/19/16 02:50, Pyun YongHyeon wrote:
>>
>> Modified: head/sys/dev/usb/net/if_axgereg.h
>>
>> ==============================================================================
>> --- head/sys/dev/usb/net/if_axgereg.h   Fri Aug 19 00:03:41 2016
>> (r304438)
>> +++ head/sys/dev/usb/net/if_axgereg.h   Fri Aug 19 00:50:32 2016
>> (r304439)
>> @@ -156,19 +156,20 @@ enum {
>>  struct axge_frame_txhdr {
>>  #if BYTE_ORDER == LITTLE_ENDIAN
>>         uint32_t                len;
>> -#define        AXGE_TXLEN_MASK         0x0001FFFF
>> -#define        AXGE_VLAN_INSERT        0x20000000
>> -#define        AXGE_CSUM_DISABLE       0x80000000
>>         uint32_t                mss;
>> -#define        AXGE_MSS_MASK           0x00003FFF
>> -#define        AXGE_PADDING            0x80008000
>> -#define        AXGE_VLAN_TAG_MASK      0xFFFF0000
>>  #else
>>         uint32_t                mss;
>>         uint32_t                len;
>>  #endif
>>  } __packed;
>>
>
> Hi,
>
> Is it correct to switch the order of mss and len variables for bit/little
> endian? Looks buggy to me.

It probably is a 64bits field.  IMHO, using a 64bits field and
mask/shift-op probably will be better here.

Thanks,
sephe

-- 
Tomorrow Will Never Die



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMOc5cxOJQr5ScoWvzfvhNpk-OdCrh%2Bi%2B1jv4eo4-1QDWzZ5Jg>