OpenWrt – Blame information for rev 4
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
4 | office | 1 | --- a/drivers/net/ethernet/korina.c |
2 | +++ b/drivers/net/ethernet/korina.c |
||
3 | @@ -64,9 +64,9 @@ |
||
4 | #include <asm/mach-rc32434/eth.h> |
||
5 | #include <asm/mach-rc32434/dma_v.h> |
||
6 | |||
7 | -#define DRV_NAME "korina" |
||
8 | -#define DRV_VERSION "0.10" |
||
9 | -#define DRV_RELDATE "04Mar2008" |
||
10 | +#define DRV_NAME "korina" |
||
11 | +#define DRV_VERSION "0.10" |
||
12 | +#define DRV_RELDATE "04Mar2008" |
||
13 | |||
14 | #define STATION_ADDRESS_HIGH(dev) (((dev)->dev_addr[0] << 8) | \ |
||
15 | ((dev)->dev_addr[1])) |
||
16 | @@ -75,7 +75,7 @@ |
||
17 | ((dev)->dev_addr[4] << 8) | \ |
||
18 | ((dev)->dev_addr[5])) |
||
19 | |||
20 | -#define MII_CLOCK 1250000 /* no more than 2.5MHz */ |
||
21 | +#define MII_CLOCK 1250000 /* no more than 2.5MHz */ |
||
22 | |||
23 | /* the following must be powers of two */ |
||
24 | #define KORINA_NUM_RDS 64 /* number of receive descriptors */ |
||
25 | @@ -87,15 +87,19 @@ |
||
26 | #define KORINA_RBSIZE 1536 /* size of one resource buffer = Ether MTU */ |
||
27 | #define KORINA_RDS_MASK (KORINA_NUM_RDS - 1) |
||
28 | #define KORINA_TDS_MASK (KORINA_NUM_TDS - 1) |
||
29 | -#define RD_RING_SIZE (KORINA_NUM_RDS * sizeof(struct dma_desc)) |
||
30 | +#define RD_RING_SIZE (KORINA_NUM_RDS * sizeof(struct dma_desc)) |
||
31 | #define TD_RING_SIZE (KORINA_NUM_TDS * sizeof(struct dma_desc)) |
||
32 | |||
33 | -#define TX_TIMEOUT (6000 * HZ / 1000) |
||
34 | +#define TX_TIMEOUT (6000 * HZ / 1000) |
||
35 | |||
36 | -enum chain_status { desc_filled, desc_empty }; |
||
37 | -#define IS_DMA_FINISHED(X) (((X) & (DMA_DESC_FINI)) != 0) |
||
38 | -#define IS_DMA_DONE(X) (((X) & (DMA_DESC_DONE)) != 0) |
||
39 | -#define RCVPKT_LENGTH(X) (((X) & ETH_RX_LEN) >> ETH_RX_LEN_BIT) |
||
40 | +enum chain_status { |
||
41 | + desc_filled, |
||
42 | + desc_empty |
||
43 | +}; |
||
44 | + |
||
45 | +#define IS_DMA_FINISHED(X) (((X) & (DMA_DESC_FINI)) != 0) |
||
46 | +#define IS_DMA_DONE(X) (((X) & (DMA_DESC_DONE)) != 0) |
||
47 | +#define RCVPKT_LENGTH(X) (((X) & ETH_RX_LEN) >> ETH_RX_LEN_BIT) |
||
48 | |||
49 | /* Information that need to be kept for each board. */ |
||
50 | struct korina_private { |
||
51 | @@ -123,7 +127,7 @@ struct korina_private { |
||
52 | int rx_irq; |
||
53 | int tx_irq; |
||
54 | |||
55 | - spinlock_t lock; /* NIC xmit lock */ |
||
56 | + spinlock_t lock; /* NIC xmit lock */ |
||
57 | |||
58 | int dma_halt_cnt; |
||
59 | int dma_run_cnt; |
||
60 | @@ -146,17 +150,17 @@ static inline void korina_start_dma(stru |
||
61 | static inline void korina_abort_dma(struct net_device *dev, |
||
62 | struct dma_reg *ch) |
||
63 | { |
||
64 | - if (readl(&ch->dmac) & DMA_CHAN_RUN_BIT) { |
||
65 | - writel(0x10, &ch->dmac); |
||
66 | + if (readl(&ch->dmac) & DMA_CHAN_RUN_BIT) { |
||
67 | + writel(0x10, &ch->dmac); |
||
68 | |||
69 | - while (!(readl(&ch->dmas) & DMA_STAT_HALT)) |
||
70 | - netif_trans_update(dev); |
||
71 | + while (!(readl(&ch->dmas) & DMA_STAT_HALT)) |
||
72 | + netif_trans_update(dev); |
||
73 | |||
74 | - writel(0, &ch->dmas); |
||
75 | - } |
||
76 | + writel(0, &ch->dmas); |
||
77 | + } |
||
78 | |||
79 | - writel(0, &ch->dmadptr); |
||
80 | - writel(0, &ch->dmandptr); |
||
81 | + writel(0, &ch->dmadptr); |
||
82 | + writel(0, &ch->dmandptr); |
||
83 | } |
||
84 | |||
85 | static inline void korina_chain_dma(struct dma_reg *ch, u32 dma_addr) |
||
86 | @@ -685,7 +689,7 @@ static int korina_ioctl(struct net_devic |
||
87 | |||
88 | /* ethtool helpers */ |
||
89 | static void netdev_get_drvinfo(struct net_device *dev, |
||
90 | - struct ethtool_drvinfo *info) |
||
91 | + struct ethtool_drvinfo *info) |
||
92 | { |
||
93 | struct korina_private *lp = netdev_priv(dev); |
||
94 | |||
95 | @@ -727,10 +731,10 @@ static u32 netdev_get_link(struct net_de |
||
96 | } |
||
97 | |||
98 | static const struct ethtool_ops netdev_ethtool_ops = { |
||
99 | - .get_drvinfo = netdev_get_drvinfo, |
||
100 | - .get_settings = netdev_get_settings, |
||
101 | - .set_settings = netdev_set_settings, |
||
102 | - .get_link = netdev_get_link, |
||
103 | + .get_drvinfo = netdev_get_drvinfo, |
||
104 | + .get_settings = netdev_get_settings, |
||
105 | + .set_settings = netdev_set_settings, |
||
106 | + .get_link = netdev_get_link, |
||
107 | }; |
||
108 | |||
109 | static int korina_alloc_ring(struct net_device *dev) |
||
110 | @@ -862,7 +866,7 @@ static int korina_init(struct net_device |
||
111 | /* Management Clock Prescaler Divisor |
||
112 | * Clock independent setting */ |
||
113 | writel(((idt_cpu_freq) / MII_CLOCK + 1) & ~1, |
||
114 | - &lp->eth_regs->ethmcp); |
||
115 | + &lp->eth_regs->ethmcp); |
||
116 | |||
117 | /* don't transmit until fifo contains 48b */ |
||
118 | writel(48, &lp->eth_regs->ethfifott); |
||
119 | @@ -945,14 +949,14 @@ static int korina_open(struct net_device |
||
120 | 0, "Korina ethernet Rx", dev); |
||
121 | if (ret < 0) { |
||
122 | printk(KERN_ERR "%s: unable to get Rx DMA IRQ %d\n", |
||
123 | - dev->name, lp->rx_irq); |
||
124 | + dev->name, lp->rx_irq); |
||
125 | goto err_release; |
||
126 | } |
||
127 | ret = request_irq(lp->tx_irq, korina_tx_dma_interrupt, |
||
128 | 0, "Korina ethernet Tx", dev); |
||
129 | if (ret < 0) { |
||
130 | printk(KERN_ERR "%s: unable to get Tx DMA IRQ %d\n", |
||
131 | - dev->name, lp->tx_irq); |
||
132 | + dev->name, lp->tx_irq); |
||
133 | goto err_free_rx_irq; |
||
134 | } |
||
135 |