[U-Boot] [PATCH 2/3][v3] dnet: driver for Dave DNET ethernet controller
Ilya Yanok
yanok at emcraft.com
Mon Feb 9 13:39:31 CET 2009
Hi Ben,
thanks for review.
Ben Warren wrote:
>> @@ -69,6 +70,7 @@ COBJS-$(CONFIG_ULI526X) += uli526x.o
>> COBJS-$(CONFIG_VSC7385_ENET) += vsc7385.o
>> COBJS-$(CONFIG_XILINX_EMAC) += xilinx_emac.o
>> COBJS-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
>> +COBJS-$(CONFIG_SH_ETHER) += sh_eth.o
>>
> Why is the SH driver affected?, or is this a merge artifact?
Uh... Sorry. Yes, it's merge artifact.
> <snip>
>> +struct dnet_registers {
>> + /* ALL DNET FIFO REGISTERS */
>> + u32 RX_LEN_FIFO;
>> + u32 RX_DATA_FIFO;
>> + u32 TX_LEN_FIFO;
>> + u32 TX_DATA_FIFO;
>> + u32 pad1[0x3c];
>> + /* ALL DNET CONTROL/STATUS REGISTERS */
>> + u32 VERCAPS;
>> + u32 INTR_SRC;
>> + u32 INTR_ENB;
>> + u32 RX_STATUS;
>> + u32 TX_STATUS;
>> + u32 RX_FRAMES_CNT;
>> + u32 TX_FRAMES_CNT;
>> + u32 RX_FIFO_TH;
>> + u32 TX_FIFO_TH;
>> + u32 SYS_CTL;
>> + u32 PAUSE_TMR;
>> + u32 RX_FIFO_WCNT;
>> + u32 TX_FIFO_WCNT;
>> + u32 pad2[0x33];
>> + /* ALL DNET MAC REGISTERS */
>> + u32 MACREG_DATA; /* Mac-Reg Data */
>> + u32 MACREG_ADDR; /* Mac-Reg Addr */
>> + u32 pad3[0x3e];
>> + /* ALL DNET RX STATISTICS COUNTERS */
>> + u32 RX_PKT_IGNR_CNT;
>> + u32 RX_LEN_CHK_ERR_CNT;
>> + u32 RX_LNG_FRM_CNT;
>> + u32 RX_SHRT_FRM_CNT;
>> + u32 RX_IPG_VIOL_CNT;
>> + u32 RX_CRC_ERR_CNT;
>> + u32 RX_OK_PKT_CNT;
>> + u32 RX_CTL_FRM_CNT;
>> + u32 RX_PAUSE_FRM_CNT;
>> + u32 RX_MULTICAST_CNT;
>> + u32 RX_BROADCAST_CNT;
>> + u32 RX_VLAN_TAG_CNT;
>> + u32 RX_PRE_SHRINK_CNT;
>> + u32 RX_DRIB_NIB_CNT;
>> + u32 RX_UNSUP_OPCD_CNT;
>> + u32 RX_BYTE_CNT;
>> + u32 pad4[0x30];
>> + /* DNET TX STATISTICS COUNTERS */
>> + u32 TX_UNICAST_CNT;
>> + u32 TX_PAUSE_FRM_CNT;
>> + u32 TX_MULTICAST_CNT;
>> + u32 TX_BRDCAST_CNT;
>> + u32 TX_VLAN_TAG_CNT;
>> + u32 TX_BAD_FCS_CNT;
>> + u32 TX_JUMBO_CNT;
>> + u32 TX_BYTE_CNT;
>> +} __attribute__((packed));
>>
> Why is this packed? All fields are 32-bit aligned already.
Generally, I prefer declaring such structures with ((packed)) regardless
of if it's really do something. Just to show that it should be packed.
Regards, Ilya.
More information about the U-Boot
mailing list