blob: add9e32d4f47f4a1253417bb55995aaeef2f80a8 [file] [log] [blame]
Pantelis Antoniou48257c42005-10-28 16:25:58 -04001/*
2 * Ethernet on Serial Communications Controller (SCC) driver for Motorola MPC8xx and MPC82xx.
3 *
Vitaly Bordug9b8ee8e2007-09-18 20:05:35 +04004 * Copyright (c) 2003 Intracom S.A.
Pantelis Antoniou48257c42005-10-28 16:25:58 -04005 * by Pantelis Antoniou <panto@intracom.gr>
Vitaly Bordug9b8ee8e2007-09-18 20:05:35 +04006 *
7 * 2005 (c) MontaVista Software, Inc.
Pantelis Antoniou48257c42005-10-28 16:25:58 -04008 * Vitaly Bordug <vbordug@ru.mvista.com>
9 *
Vitaly Bordug9b8ee8e2007-09-18 20:05:35 +040010 * This file is licensed under the terms of the GNU General Public License
11 * version 2. This program is licensed "as is" without any warranty of any
Pantelis Antoniou48257c42005-10-28 16:25:58 -040012 * kind, whether express or implied.
13 */
14
Pantelis Antoniou48257c42005-10-28 16:25:58 -040015#include <linux/module.h>
16#include <linux/kernel.h>
17#include <linux/types.h>
Pantelis Antoniou48257c42005-10-28 16:25:58 -040018#include <linux/string.h>
19#include <linux/ptrace.h>
20#include <linux/errno.h>
21#include <linux/ioport.h>
22#include <linux/slab.h>
23#include <linux/interrupt.h>
Pantelis Antoniou48257c42005-10-28 16:25:58 -040024#include <linux/init.h>
25#include <linux/delay.h>
26#include <linux/netdevice.h>
27#include <linux/etherdevice.h>
28#include <linux/skbuff.h>
29#include <linux/spinlock.h>
30#include <linux/mii.h>
31#include <linux/ethtool.h>
32#include <linux/bitops.h>
33#include <linux/fs.h>
Marcelo Tosattif7b99962005-11-09 11:00:16 -020034#include <linux/platform_device.h>
Pantelis Antoniou48257c42005-10-28 16:25:58 -040035
36#include <asm/irq.h>
37#include <asm/uaccess.h>
38
39#ifdef CONFIG_8xx
40#include <asm/8xx_immap.h>
41#include <asm/pgtable.h>
42#include <asm/mpc8xx.h>
43#include <asm/commproc.h>
44#endif
45
Scott Wood976de6a2007-10-02 10:55:58 -050046#ifdef CONFIG_PPC_CPM_NEW_BINDING
47#include <asm/of_platform.h>
48#endif
49
Pantelis Antoniou48257c42005-10-28 16:25:58 -040050#include "fs_enet.h"
51
52/*************************************************/
53
54#if defined(CONFIG_CPM1)
55/* for a 8xx __raw_xxx's are sufficient */
56#define __fs_out32(addr, x) __raw_writel(x, addr)
57#define __fs_out16(addr, x) __raw_writew(x, addr)
58#define __fs_out8(addr, x) __raw_writeb(x, addr)
59#define __fs_in32(addr) __raw_readl(addr)
60#define __fs_in16(addr) __raw_readw(addr)
61#define __fs_in8(addr) __raw_readb(addr)
62#else
63/* for others play it safe */
64#define __fs_out32(addr, x) out_be32(addr, x)
65#define __fs_out16(addr, x) out_be16(addr, x)
66#define __fs_in32(addr) in_be32(addr)
67#define __fs_in16(addr) in_be16(addr)
68#endif
69
70/* write, read, set bits, clear bits */
71#define W32(_p, _m, _v) __fs_out32(&(_p)->_m, (_v))
72#define R32(_p, _m) __fs_in32(&(_p)->_m)
73#define S32(_p, _m, _v) W32(_p, _m, R32(_p, _m) | (_v))
74#define C32(_p, _m, _v) W32(_p, _m, R32(_p, _m) & ~(_v))
75
76#define W16(_p, _m, _v) __fs_out16(&(_p)->_m, (_v))
77#define R16(_p, _m) __fs_in16(&(_p)->_m)
78#define S16(_p, _m, _v) W16(_p, _m, R16(_p, _m) | (_v))
79#define C16(_p, _m, _v) W16(_p, _m, R16(_p, _m) & ~(_v))
80
81#define W8(_p, _m, _v) __fs_out8(&(_p)->_m, (_v))
82#define R8(_p, _m) __fs_in8(&(_p)->_m)
83#define S8(_p, _m, _v) W8(_p, _m, R8(_p, _m) | (_v))
84#define C8(_p, _m, _v) W8(_p, _m, R8(_p, _m) & ~(_v))
85
86#define SCC_MAX_MULTICAST_ADDRS 64
87
88/*
Vitaly Bordug9b8ee8e2007-09-18 20:05:35 +040089 * Delay to wait for SCC reset command to complete (in us)
Pantelis Antoniou48257c42005-10-28 16:25:58 -040090 */
91#define SCC_RESET_DELAY 50
92#define MAX_CR_CMD_LOOPS 10000
93
94static inline int scc_cr_cmd(struct fs_enet_private *fep, u32 op)
95{
Scott Wood976de6a2007-10-02 10:55:58 -050096 const struct fs_platform_info *fpi = fep->fpi;
97 int i;
Pantelis Antoniou48257c42005-10-28 16:25:58 -040098
Scott Wood976de6a2007-10-02 10:55:58 -050099 W16(cpmp, cp_cpcr, fpi->cp_command | CPM_CR_FLG | (op << 8));
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400100 for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
101 if ((R16(cpmp, cp_cpcr) & CPM_CR_FLG) == 0)
Scott Wood976de6a2007-10-02 10:55:58 -0500102 return 0;
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400103
Scott Wood976de6a2007-10-02 10:55:58 -0500104 printk(KERN_ERR "%s(): Not able to issue CPM command\n",
105 __FUNCTION__);
106 return 1;
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400107}
108
109static int do_pd_setup(struct fs_enet_private *fep)
110{
Scott Wood976de6a2007-10-02 10:55:58 -0500111#ifdef CONFIG_PPC_CPM_NEW_BINDING
112 struct of_device *ofdev = to_of_device(fep->dev);
113
114 fep->interrupt = of_irq_to_resource(ofdev->node, 0, NULL);
115 if (fep->interrupt == NO_IRQ)
116 return -EINVAL;
117
118 fep->scc.sccp = of_iomap(ofdev->node, 0);
119 if (!fep->scc.sccp)
120 return -EINVAL;
121
122 fep->scc.ep = of_iomap(ofdev->node, 1);
123 if (!fep->scc.ep) {
124 iounmap(fep->scc.sccp);
125 return -EINVAL;
126 }
127#else
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400128 struct platform_device *pdev = to_platform_device(fep->dev);
129 struct resource *r;
130
131 /* Fill out IRQ field */
132 fep->interrupt = platform_get_irq_byname(pdev, "interrupt");
David Vrabel48944732006-01-19 17:56:29 +0000133 if (fep->interrupt < 0)
134 return -EINVAL;
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400135
136 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
Vitaly Bordugb1f54ba2007-01-27 00:00:04 -0800137 fep->scc.sccp = ioremap(r->start, r->end - r->start + 1);
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400138
139 if (fep->scc.sccp == NULL)
140 return -EINVAL;
141
142 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pram");
Vitaly Bordugb1f54ba2007-01-27 00:00:04 -0800143 fep->scc.ep = ioremap(r->start, r->end - r->start + 1);
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400144
145 if (fep->scc.ep == NULL)
146 return -EINVAL;
Scott Wood976de6a2007-10-02 10:55:58 -0500147#endif
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400148
149 return 0;
150}
151
152#define SCC_NAPI_RX_EVENT_MSK (SCCE_ENET_RXF | SCCE_ENET_RXB)
153#define SCC_RX_EVENT (SCCE_ENET_RXF)
154#define SCC_TX_EVENT (SCCE_ENET_TXB)
155#define SCC_ERR_EVENT_MSK (SCCE_ENET_TXE | SCCE_ENET_BSY)
156
157static int setup_data(struct net_device *dev)
158{
159 struct fs_enet_private *fep = netdev_priv(dev);
Scott Wood976de6a2007-10-02 10:55:58 -0500160
161#ifdef CONFIG_PPC_CPM_NEW_BINDING
162 struct fs_platform_info *fpi = fep->fpi;
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400163
164 fep->scc.idx = fs_get_scc_index(fpi->fs_no);
Scott Wood976de6a2007-10-02 10:55:58 -0500165 if ((unsigned int)fep->fcc.idx >= 4) /* max 4 SCCs */
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400166 return -EINVAL;
167
Scott Wood976de6a2007-10-02 10:55:58 -0500168 fpi->cp_command = fep->fcc.idx << 6;
169#endif
170
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400171 do_pd_setup(fep);
172
173 fep->scc.hthi = 0;
174 fep->scc.htlo = 0;
175
176 fep->ev_napi_rx = SCC_NAPI_RX_EVENT_MSK;
177 fep->ev_rx = SCC_RX_EVENT;
Scott Wood976de6a2007-10-02 10:55:58 -0500178 fep->ev_tx = SCC_TX_EVENT | SCCE_ENET_TXE;
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400179 fep->ev_err = SCC_ERR_EVENT_MSK;
180
181 return 0;
182}
183
184static int allocate_bd(struct net_device *dev)
185{
186 struct fs_enet_private *fep = netdev_priv(dev);
187 const struct fs_platform_info *fpi = fep->fpi;
188
189 fep->ring_mem_addr = cpm_dpalloc((fpi->tx_ring + fpi->rx_ring) *
190 sizeof(cbd_t), 8);
Timur Tabi4c356302007-05-08 14:46:36 -0500191 if (IS_ERR_VALUE(fep->ring_mem_addr))
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400192 return -ENOMEM;
193
194 fep->ring_base = cpm_dpram_addr(fep->ring_mem_addr);
195
196 return 0;
197}
198
199static void free_bd(struct net_device *dev)
200{
201 struct fs_enet_private *fep = netdev_priv(dev);
202
203 if (fep->ring_base)
204 cpm_dpfree(fep->ring_mem_addr);
205}
206
207static void cleanup_data(struct net_device *dev)
208{
209 /* nothing */
210}
211
212static void set_promiscuous_mode(struct net_device *dev)
Vitaly Bordug9b8ee8e2007-09-18 20:05:35 +0400213{
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400214 struct fs_enet_private *fep = netdev_priv(dev);
215 scc_t *sccp = fep->scc.sccp;
216
217 S16(sccp, scc_psmr, SCC_PSMR_PRO);
218}
219
220static void set_multicast_start(struct net_device *dev)
221{
222 struct fs_enet_private *fep = netdev_priv(dev);
223 scc_enet_t *ep = fep->scc.ep;
224
225 W16(ep, sen_gaddr1, 0);
226 W16(ep, sen_gaddr2, 0);
227 W16(ep, sen_gaddr3, 0);
228 W16(ep, sen_gaddr4, 0);
229}
230
231static void set_multicast_one(struct net_device *dev, const u8 * mac)
232{
233 struct fs_enet_private *fep = netdev_priv(dev);
234 scc_enet_t *ep = fep->scc.ep;
235 u16 taddrh, taddrm, taddrl;
236
237 taddrh = ((u16) mac[5] << 8) | mac[4];
238 taddrm = ((u16) mac[3] << 8) | mac[2];
239 taddrl = ((u16) mac[1] << 8) | mac[0];
240
241 W16(ep, sen_taddrh, taddrh);
242 W16(ep, sen_taddrm, taddrm);
243 W16(ep, sen_taddrl, taddrl);
244 scc_cr_cmd(fep, CPM_CR_SET_GADDR);
245}
246
247static void set_multicast_finish(struct net_device *dev)
248{
249 struct fs_enet_private *fep = netdev_priv(dev);
250 scc_t *sccp = fep->scc.sccp;
251 scc_enet_t *ep = fep->scc.ep;
252
253 /* clear promiscuous always */
254 C16(sccp, scc_psmr, SCC_PSMR_PRO);
255
256 /* if all multi or too many multicasts; just enable all */
257 if ((dev->flags & IFF_ALLMULTI) != 0 ||
258 dev->mc_count > SCC_MAX_MULTICAST_ADDRS) {
259
260 W16(ep, sen_gaddr1, 0xffff);
261 W16(ep, sen_gaddr2, 0xffff);
262 W16(ep, sen_gaddr3, 0xffff);
263 W16(ep, sen_gaddr4, 0xffff);
264 }
265}
266
267static void set_multicast_list(struct net_device *dev)
268{
269 struct dev_mc_list *pmc;
270
271 if ((dev->flags & IFF_PROMISC) == 0) {
272 set_multicast_start(dev);
273 for (pmc = dev->mc_list; pmc != NULL; pmc = pmc->next)
274 set_multicast_one(dev, pmc->dmi_addr);
275 set_multicast_finish(dev);
276 } else
277 set_promiscuous_mode(dev);
278}
279
280/*
281 * This function is called to start or restart the FEC during a link
282 * change. This only happens when switching between half and full
283 * duplex.
284 */
285static void restart(struct net_device *dev)
286{
287 struct fs_enet_private *fep = netdev_priv(dev);
288 scc_t *sccp = fep->scc.sccp;
289 scc_enet_t *ep = fep->scc.ep;
290 const struct fs_platform_info *fpi = fep->fpi;
291 u16 paddrh, paddrm, paddrl;
292 const unsigned char *mac;
293 int i;
294
295 C32(sccp, scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
296
297 /* clear everything (slow & steady does it) */
298 for (i = 0; i < sizeof(*ep); i++)
299 __fs_out8((char *)ep + i, 0);
300
301 /* point to bds */
302 W16(ep, sen_genscc.scc_rbase, fep->ring_mem_addr);
303 W16(ep, sen_genscc.scc_tbase,
304 fep->ring_mem_addr + sizeof(cbd_t) * fpi->rx_ring);
305
306 /* Initialize function code registers for big-endian.
307 */
308 W8(ep, sen_genscc.scc_rfcr, SCC_EB);
309 W8(ep, sen_genscc.scc_tfcr, SCC_EB);
310
311 /* Set maximum bytes per receive buffer.
312 * This appears to be an Ethernet frame size, not the buffer
313 * fragment size. It must be a multiple of four.
314 */
315 W16(ep, sen_genscc.scc_mrblr, 0x5f0);
316
317 /* Set CRC preset and mask.
318 */
319 W32(ep, sen_cpres, 0xffffffff);
320 W32(ep, sen_cmask, 0xdebb20e3);
321
322 W32(ep, sen_crcec, 0); /* CRC Error counter */
323 W32(ep, sen_alec, 0); /* alignment error counter */
324 W32(ep, sen_disfc, 0); /* discard frame counter */
325
326 W16(ep, sen_pads, 0x8888); /* Tx short frame pad character */
327 W16(ep, sen_retlim, 15); /* Retry limit threshold */
328
329 W16(ep, sen_maxflr, 0x5ee); /* maximum frame length register */
330
331 W16(ep, sen_minflr, PKT_MINBUF_SIZE); /* minimum frame length register */
332
333 W16(ep, sen_maxd1, 0x000005f0); /* maximum DMA1 length */
334 W16(ep, sen_maxd2, 0x000005f0); /* maximum DMA2 length */
335
336 /* Clear hash tables.
337 */
338 W16(ep, sen_gaddr1, 0);
339 W16(ep, sen_gaddr2, 0);
340 W16(ep, sen_gaddr3, 0);
341 W16(ep, sen_gaddr4, 0);
342 W16(ep, sen_iaddr1, 0);
343 W16(ep, sen_iaddr2, 0);
344 W16(ep, sen_iaddr3, 0);
345 W16(ep, sen_iaddr4, 0);
346
Vitaly Bordug9b8ee8e2007-09-18 20:05:35 +0400347 /* set address
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400348 */
349 mac = dev->dev_addr;
350 paddrh = ((u16) mac[5] << 8) | mac[4];
351 paddrm = ((u16) mac[3] << 8) | mac[2];
352 paddrl = ((u16) mac[1] << 8) | mac[0];
353
354 W16(ep, sen_paddrh, paddrh);
355 W16(ep, sen_paddrm, paddrm);
356 W16(ep, sen_paddrl, paddrl);
357
358 W16(ep, sen_pper, 0);
359 W16(ep, sen_taddrl, 0);
360 W16(ep, sen_taddrm, 0);
361 W16(ep, sen_taddrh, 0);
362
363 fs_init_bds(dev);
364
365 scc_cr_cmd(fep, CPM_CR_INIT_TRX);
366
367 W16(sccp, scc_scce, 0xffff);
368
Vitaly Bordug9b8ee8e2007-09-18 20:05:35 +0400369 /* Enable interrupts we wish to service.
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400370 */
371 W16(sccp, scc_sccm, SCCE_ENET_TXE | SCCE_ENET_RXF | SCCE_ENET_TXB);
372
373 /* Set GSMR_H to enable all normal operating modes.
374 * Set GSMR_L to enable Ethernet to MC68160.
375 */
376 W32(sccp, scc_gsmrh, 0);
377 W32(sccp, scc_gsmrl,
378 SCC_GSMRL_TCI | SCC_GSMRL_TPL_48 | SCC_GSMRL_TPP_10 |
379 SCC_GSMRL_MODE_ENET);
380
381 /* Set sync/delimiters.
382 */
383 W16(sccp, scc_dsr, 0xd555);
384
385 /* Set processing mode. Use Ethernet CRC, catch broadcast, and
386 * start frame search 22 bit times after RENA.
387 */
388 W16(sccp, scc_psmr, SCC_PSMR_ENCRC | SCC_PSMR_NIB22);
389
390 /* Set full duplex mode if needed */
Vitaly Bordug5b4b8452006-08-14 23:00:30 -0700391 if (fep->phydev->duplex)
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400392 S16(sccp, scc_psmr, SCC_PSMR_LPB | SCC_PSMR_FDE);
393
394 S32(sccp, scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
395}
396
Vitaly Bordug9b8ee8e2007-09-18 20:05:35 +0400397static void stop(struct net_device *dev)
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400398{
399 struct fs_enet_private *fep = netdev_priv(dev);
400 scc_t *sccp = fep->scc.sccp;
401 int i;
402
403 for (i = 0; (R16(sccp, scc_sccm) == 0) && i < SCC_RESET_DELAY; i++)
404 udelay(1);
405
406 if (i == SCC_RESET_DELAY)
407 printk(KERN_WARNING DRV_MODULE_NAME
408 ": %s SCC timeout on graceful transmit stop\n",
409 dev->name);
410
411 W16(sccp, scc_sccm, 0);
412 C32(sccp, scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
413
414 fs_cleanup_bds(dev);
415}
416
417static void pre_request_irq(struct net_device *dev, int irq)
418{
Vitaly Bordugb1f54ba2007-01-27 00:00:04 -0800419#ifndef CONFIG_PPC_MERGE
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400420 immap_t *immap = fs_enet_immap;
421 u32 siel;
422
423 /* SIU interrupt */
424 if (irq >= SIU_IRQ0 && irq < SIU_LEVEL7) {
425
426 siel = in_be32(&immap->im_siu_conf.sc_siel);
427 if ((irq & 1) == 0)
428 siel |= (0x80000000 >> irq);
429 else
430 siel &= ~(0x80000000 >> (irq & ~1));
431 out_be32(&immap->im_siu_conf.sc_siel, siel);
432 }
Vitaly Bordugb1f54ba2007-01-27 00:00:04 -0800433#endif
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400434}
435
436static void post_free_irq(struct net_device *dev, int irq)
437{
438 /* nothing */
439}
440
441static void napi_clear_rx_event(struct net_device *dev)
442{
443 struct fs_enet_private *fep = netdev_priv(dev);
444 scc_t *sccp = fep->scc.sccp;
445
446 W16(sccp, scc_scce, SCC_NAPI_RX_EVENT_MSK);
447}
448
449static void napi_enable_rx(struct net_device *dev)
450{
451 struct fs_enet_private *fep = netdev_priv(dev);
452 scc_t *sccp = fep->scc.sccp;
453
454 S16(sccp, scc_sccm, SCC_NAPI_RX_EVENT_MSK);
455}
456
457static void napi_disable_rx(struct net_device *dev)
458{
459 struct fs_enet_private *fep = netdev_priv(dev);
460 scc_t *sccp = fep->scc.sccp;
461
462 C16(sccp, scc_sccm, SCC_NAPI_RX_EVENT_MSK);
463}
464
465static void rx_bd_done(struct net_device *dev)
466{
467 /* nothing */
468}
469
470static void tx_kickstart(struct net_device *dev)
471{
472 /* nothing */
473}
474
475static u32 get_int_events(struct net_device *dev)
476{
477 struct fs_enet_private *fep = netdev_priv(dev);
478 scc_t *sccp = fep->scc.sccp;
479
480 return (u32) R16(sccp, scc_scce);
481}
482
483static void clear_int_events(struct net_device *dev, u32 int_events)
484{
485 struct fs_enet_private *fep = netdev_priv(dev);
486 scc_t *sccp = fep->scc.sccp;
487
488 W16(sccp, scc_scce, int_events & 0xffff);
489}
490
491static void ev_error(struct net_device *dev, u32 int_events)
492{
493 printk(KERN_WARNING DRV_MODULE_NAME
494 ": %s SCC ERROR(s) 0x%x\n", dev->name, int_events);
495}
496
497static int get_regs(struct net_device *dev, void *p, int *sizep)
498{
499 struct fs_enet_private *fep = netdev_priv(dev);
500
501 if (*sizep < sizeof(scc_t) + sizeof(scc_enet_t))
502 return -EINVAL;
503
504 memcpy_fromio(p, fep->scc.sccp, sizeof(scc_t));
505 p = (char *)p + sizeof(scc_t);
506
507 memcpy_fromio(p, fep->scc.ep, sizeof(scc_enet_t));
508
509 return 0;
510}
511
512static int get_regs_len(struct net_device *dev)
513{
514 return sizeof(scc_t) + sizeof(scc_enet_t);
515}
516
517static void tx_restart(struct net_device *dev)
518{
519 struct fs_enet_private *fep = netdev_priv(dev);
520
521 scc_cr_cmd(fep, CPM_CR_RESTART_TX);
522}
523
Vitaly Bordug5b4b8452006-08-14 23:00:30 -0700524
525
Pantelis Antoniou48257c42005-10-28 16:25:58 -0400526/*************************************************************************/
527
528const struct fs_ops fs_scc_ops = {
529 .setup_data = setup_data,
530 .cleanup_data = cleanup_data,
531 .set_multicast_list = set_multicast_list,
532 .restart = restart,
533 .stop = stop,
534 .pre_request_irq = pre_request_irq,
535 .post_free_irq = post_free_irq,
536 .napi_clear_rx_event = napi_clear_rx_event,
537 .napi_enable_rx = napi_enable_rx,
538 .napi_disable_rx = napi_disable_rx,
539 .rx_bd_done = rx_bd_done,
540 .tx_kickstart = tx_kickstart,
541 .get_int_events = get_int_events,
542 .clear_int_events = clear_int_events,
543 .ev_error = ev_error,
544 .get_regs = get_regs,
545 .get_regs_len = get_regs_len,
546 .tx_restart = tx_restart,
547 .allocate_bd = allocate_bd,
548 .free_bd = free_bd,
549};