mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-09-22 07:32:03 +00:00
net: dc2114x: Clean up remaining driver code
Clean up the remaining driver code, macro space alignment, function declaration indent, replace __attribute__((aligned(32))) with plain __aligned(32). No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
2e5c2a103e
commit
eb216f1e00
1 changed files with 41 additions and 41 deletions
|
@ -12,8 +12,7 @@
|
|||
|
||||
#undef UPDATE_SROM
|
||||
|
||||
/* PCI Registers.
|
||||
*/
|
||||
/* PCI Registers. */
|
||||
#define PCI_CFDA_PSM 0x43
|
||||
|
||||
#define CFRV_RN 0x000000f0 /* Revision Number */
|
||||
|
@ -23,8 +22,7 @@
|
|||
|
||||
#define DC2114x_BRK 0x0020 /* CFRV break between DC21142 & DC21143 */
|
||||
|
||||
/* Ethernet chip registers.
|
||||
*/
|
||||
/* Ethernet chip registers. */
|
||||
#define DE4X5_BMR 0x000 /* Bus Mode Register */
|
||||
#define DE4X5_TPD 0x008 /* Transmit Poll Demand Reg */
|
||||
#define DE4X5_RRBA 0x018 /* RX Ring Base Address Reg */
|
||||
|
@ -34,8 +32,7 @@
|
|||
#define DE4X5_SICR 0x068 /* SIA Connectivity Register */
|
||||
#define DE4X5_APROM 0x048 /* Ethernet Address PROM */
|
||||
|
||||
/* Register bits.
|
||||
*/
|
||||
/* Register bits. */
|
||||
#define BMR_SWR 0x00000001 /* Software Reset */
|
||||
#define STS_TS 0x00700000 /* Transmit Process State */
|
||||
#define STS_RS 0x000e0000 /* Receive Process State */
|
||||
|
@ -45,8 +42,7 @@
|
|||
#define OMR_SDP 0x02000000 /* SD Polarity - MUST BE ASSERTED */
|
||||
#define OMR_PM 0x00000080 /* Pass All Multicast */
|
||||
|
||||
/* Descriptor bits.
|
||||
*/
|
||||
/* Descriptor bits. */
|
||||
#define R_OWN 0x80000000 /* Own Bit */
|
||||
#define RD_RER 0x02000000 /* Receive End Of Ring */
|
||||
#define RD_LS 0x00000100 /* Last Descriptor */
|
||||
|
@ -118,20 +114,24 @@ struct de4x5_desc {
|
|||
u32 next;
|
||||
};
|
||||
|
||||
static struct de4x5_desc rx_ring[NUM_RX_DESC] __attribute__ ((aligned(32))); /* RX descriptor ring */
|
||||
static struct de4x5_desc tx_ring[NUM_TX_DESC] __attribute__ ((aligned(32))); /* TX descriptor ring */
|
||||
/* RX and TX descriptor ring */
|
||||
static struct de4x5_desc rx_ring[NUM_RX_DESC] __aligned(32);
|
||||
static struct de4x5_desc tx_ring[NUM_TX_DESC] __aligned(32);
|
||||
static int rx_new; /* RX descriptor ring pointer */
|
||||
static int tx_new; /* TX descriptor ring pointer */
|
||||
|
||||
static char rxRingSize;
|
||||
static char txRingSize;
|
||||
static char rx_ring_size;
|
||||
static char tx_ring_size;
|
||||
|
||||
static void sendto_srom(struct eth_device *dev, u_int command, u_long addr);
|
||||
static int getfrom_srom(struct eth_device *dev, u_long addr);
|
||||
static int do_eeprom_cmd(struct eth_device *dev, u_long ioaddr,int cmd,int cmd_len);
|
||||
static int do_read_eeprom(struct eth_device *dev,u_long ioaddr,int location,int addr_len);
|
||||
static int do_eeprom_cmd(struct eth_device *dev, u_long ioaddr,
|
||||
int cmd, int cmd_len);
|
||||
static int do_read_eeprom(struct eth_device *dev, u_long ioaddr,
|
||||
int location, int addr_len);
|
||||
#ifdef UPDATE_SROM
|
||||
static int write_srom(struct eth_device *dev, u_long ioaddr, int index, int new_value);
|
||||
static int write_srom(struct eth_device *dev, u_long ioaddr,
|
||||
int index, int new_value);
|
||||
static void update_srom(struct eth_device *dev, bd_t *bis);
|
||||
#endif
|
||||
static int read_srom(struct eth_device *dev, u_long ioaddr, int index);
|
||||
|
@ -281,12 +281,12 @@ static int dc21x4x_init(struct eth_device *dev, bd_t *bis)
|
|||
tx_ring[i].next = 0;
|
||||
}
|
||||
|
||||
rxRingSize = NUM_RX_DESC;
|
||||
txRingSize = NUM_TX_DESC;
|
||||
rx_ring_size = NUM_RX_DESC;
|
||||
tx_ring_size = NUM_TX_DESC;
|
||||
|
||||
/* Write the end of list marker to the descriptor lists. */
|
||||
rx_ring[rxRingSize - 1].des1 |= cpu_to_le32(RD_RER);
|
||||
tx_ring[txRingSize - 1].des1 |= cpu_to_le32(TD_TER);
|
||||
rx_ring[rx_ring_size - 1].des1 |= cpu_to_le32(RD_RER);
|
||||
tx_ring[tx_ring_size - 1].des1 |= cpu_to_le32(TD_TER);
|
||||
|
||||
/* Tell the adapter where the TX/RX rings are located. */
|
||||
OUTL(dev, phys_to_bus((u32)&rx_ring), DE4X5_RRBA);
|
||||
|
@ -380,7 +380,7 @@ static int dc21x4x_recv(struct eth_device *dev)
|
|||
}
|
||||
|
||||
/* Update entry information. */
|
||||
rx_new = (rx_new + 1) % rxRingSize;
|
||||
rx_new = (rx_new + 1) % rx_ring_size;
|
||||
}
|
||||
|
||||
return length;
|
||||
|
|
Loading…
Reference in a new issue