mac-fcc.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. /*
  2. * FCC driver for Motorola MPC82xx (PQ2).
  3. *
  4. * Copyright (c) 2003 Intracom S.A.
  5. * by Pantelis Antoniou <panto@intracom.gr>
  6. *
  7. * 2005 (c) MontaVista Software, Inc.
  8. * Vitaly Bordug <vbordug@ru.mvista.com>
  9. *
  10. * 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
  12. * kind, whether express or implied.
  13. */
  14. #include <linux/module.h>
  15. #include <linux/kernel.h>
  16. #include <linux/types.h>
  17. #include <linux/string.h>
  18. #include <linux/ptrace.h>
  19. #include <linux/errno.h>
  20. #include <linux/ioport.h>
  21. #include <linux/interrupt.h>
  22. #include <linux/delay.h>
  23. #include <linux/netdevice.h>
  24. #include <linux/etherdevice.h>
  25. #include <linux/skbuff.h>
  26. #include <linux/spinlock.h>
  27. #include <linux/mii.h>
  28. #include <linux/ethtool.h>
  29. #include <linux/bitops.h>
  30. #include <linux/fs.h>
  31. #include <linux/platform_device.h>
  32. #include <linux/phy.h>
  33. #include <linux/of_address.h>
  34. #include <linux/of_device.h>
  35. #include <linux/of_irq.h>
  36. #include <linux/gfp.h>
  37. #include <asm/immap_cpm2.h>
  38. #include <asm/mpc8260.h>
  39. #include <asm/cpm2.h>
  40. #include <asm/pgtable.h>
  41. #include <asm/irq.h>
  42. #include <asm/uaccess.h>
  43. #include "fs_enet.h"
  44. /*************************************************/
  45. /* FCC access macros */
  46. /* write, read, set bits, clear bits */
  47. #define W32(_p, _m, _v) out_be32(&(_p)->_m, (_v))
  48. #define R32(_p, _m) in_be32(&(_p)->_m)
  49. #define S32(_p, _m, _v) W32(_p, _m, R32(_p, _m) | (_v))
  50. #define C32(_p, _m, _v) W32(_p, _m, R32(_p, _m) & ~(_v))
  51. #define W16(_p, _m, _v) out_be16(&(_p)->_m, (_v))
  52. #define R16(_p, _m) in_be16(&(_p)->_m)
  53. #define S16(_p, _m, _v) W16(_p, _m, R16(_p, _m) | (_v))
  54. #define C16(_p, _m, _v) W16(_p, _m, R16(_p, _m) & ~(_v))
  55. #define W8(_p, _m, _v) out_8(&(_p)->_m, (_v))
  56. #define R8(_p, _m) in_8(&(_p)->_m)
  57. #define S8(_p, _m, _v) W8(_p, _m, R8(_p, _m) | (_v))
  58. #define C8(_p, _m, _v) W8(_p, _m, R8(_p, _m) & ~(_v))
  59. /*************************************************/
  60. #define FCC_MAX_MULTICAST_ADDRS 64
  61. #define mk_mii_read(REG) (0x60020000 | ((REG & 0x1f) << 18))
  62. #define mk_mii_write(REG, VAL) (0x50020000 | ((REG & 0x1f) << 18) | (VAL & 0xffff))
  63. #define mk_mii_end 0
  64. #define MAX_CR_CMD_LOOPS 10000
  65. static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 op)
  66. {
  67. const struct fs_platform_info *fpi = fep->fpi;
  68. return cpm_command(fpi->cp_command, op);
  69. }
  70. static int do_pd_setup(struct fs_enet_private *fep)
  71. {
  72. struct platform_device *ofdev = to_platform_device(fep->dev);
  73. struct fs_platform_info *fpi = fep->fpi;
  74. int ret = -EINVAL;
  75. fep->interrupt = irq_of_parse_and_map(ofdev->dev.of_node, 0);
  76. if (!fep->interrupt)
  77. goto out;
  78. fep->fcc.fccp = of_iomap(ofdev->dev.of_node, 0);
  79. if (!fep->fcc.fccp)
  80. goto out;
  81. fep->fcc.ep = of_iomap(ofdev->dev.of_node, 1);
  82. if (!fep->fcc.ep)
  83. goto out_fccp;
  84. fep->fcc.fcccp = of_iomap(ofdev->dev.of_node, 2);
  85. if (!fep->fcc.fcccp)
  86. goto out_ep;
  87. fep->fcc.mem = (void __iomem *)cpm2_immr;
  88. fpi->dpram_offset = cpm_dpalloc(128, 32);
  89. if (IS_ERR_VALUE(fpi->dpram_offset)) {
  90. ret = fpi->dpram_offset;
  91. goto out_fcccp;
  92. }
  93. return 0;
  94. out_fcccp:
  95. iounmap(fep->fcc.fcccp);
  96. out_ep:
  97. iounmap(fep->fcc.ep);
  98. out_fccp:
  99. iounmap(fep->fcc.fccp);
  100. out:
  101. return ret;
  102. }
  103. #define FCC_NAPI_EVENT_MSK (FCC_ENET_RXF | FCC_ENET_RXB | FCC_ENET_TXB)
  104. #define FCC_EVENT (FCC_ENET_RXF | FCC_ENET_TXB)
  105. #define FCC_ERR_EVENT_MSK (FCC_ENET_TXE)
  106. static int setup_data(struct net_device *dev)
  107. {
  108. struct fs_enet_private *fep = netdev_priv(dev);
  109. if (do_pd_setup(fep) != 0)
  110. return -EINVAL;
  111. fep->ev_napi = FCC_NAPI_EVENT_MSK;
  112. fep->ev = FCC_EVENT;
  113. fep->ev_err = FCC_ERR_EVENT_MSK;
  114. return 0;
  115. }
  116. static int allocate_bd(struct net_device *dev)
  117. {
  118. struct fs_enet_private *fep = netdev_priv(dev);
  119. const struct fs_platform_info *fpi = fep->fpi;
  120. fep->ring_base = (void __iomem __force *)dma_alloc_coherent(fep->dev,
  121. (fpi->tx_ring + fpi->rx_ring) *
  122. sizeof(cbd_t), &fep->ring_mem_addr,
  123. GFP_KERNEL);
  124. if (fep->ring_base == NULL)
  125. return -ENOMEM;
  126. return 0;
  127. }
  128. static void free_bd(struct net_device *dev)
  129. {
  130. struct fs_enet_private *fep = netdev_priv(dev);
  131. const struct fs_platform_info *fpi = fep->fpi;
  132. if (fep->ring_base)
  133. dma_free_coherent(fep->dev,
  134. (fpi->tx_ring + fpi->rx_ring) * sizeof(cbd_t),
  135. (void __force *)fep->ring_base, fep->ring_mem_addr);
  136. }
  137. static void cleanup_data(struct net_device *dev)
  138. {
  139. /* nothing */
  140. }
  141. static void set_promiscuous_mode(struct net_device *dev)
  142. {
  143. struct fs_enet_private *fep = netdev_priv(dev);
  144. fcc_t __iomem *fccp = fep->fcc.fccp;
  145. S32(fccp, fcc_fpsmr, FCC_PSMR_PRO);
  146. }
  147. static void set_multicast_start(struct net_device *dev)
  148. {
  149. struct fs_enet_private *fep = netdev_priv(dev);
  150. fcc_enet_t __iomem *ep = fep->fcc.ep;
  151. W32(ep, fen_gaddrh, 0);
  152. W32(ep, fen_gaddrl, 0);
  153. }
  154. static void set_multicast_one(struct net_device *dev, const u8 *mac)
  155. {
  156. struct fs_enet_private *fep = netdev_priv(dev);
  157. fcc_enet_t __iomem *ep = fep->fcc.ep;
  158. u16 taddrh, taddrm, taddrl;
  159. taddrh = ((u16)mac[5] << 8) | mac[4];
  160. taddrm = ((u16)mac[3] << 8) | mac[2];
  161. taddrl = ((u16)mac[1] << 8) | mac[0];
  162. W16(ep, fen_taddrh, taddrh);
  163. W16(ep, fen_taddrm, taddrm);
  164. W16(ep, fen_taddrl, taddrl);
  165. fcc_cr_cmd(fep, CPM_CR_SET_GADDR);
  166. }
  167. static void set_multicast_finish(struct net_device *dev)
  168. {
  169. struct fs_enet_private *fep = netdev_priv(dev);
  170. fcc_t __iomem *fccp = fep->fcc.fccp;
  171. fcc_enet_t __iomem *ep = fep->fcc.ep;
  172. /* clear promiscuous always */
  173. C32(fccp, fcc_fpsmr, FCC_PSMR_PRO);
  174. /* if all multi or too many multicasts; just enable all */
  175. if ((dev->flags & IFF_ALLMULTI) != 0 ||
  176. netdev_mc_count(dev) > FCC_MAX_MULTICAST_ADDRS) {
  177. W32(ep, fen_gaddrh, 0xffffffff);
  178. W32(ep, fen_gaddrl, 0xffffffff);
  179. }
  180. /* read back */
  181. fep->fcc.gaddrh = R32(ep, fen_gaddrh);
  182. fep->fcc.gaddrl = R32(ep, fen_gaddrl);
  183. }
  184. static void set_multicast_list(struct net_device *dev)
  185. {
  186. struct netdev_hw_addr *ha;
  187. if ((dev->flags & IFF_PROMISC) == 0) {
  188. set_multicast_start(dev);
  189. netdev_for_each_mc_addr(ha, dev)
  190. set_multicast_one(dev, ha->addr);
  191. set_multicast_finish(dev);
  192. } else
  193. set_promiscuous_mode(dev);
  194. }
  195. static void restart(struct net_device *dev)
  196. {
  197. struct fs_enet_private *fep = netdev_priv(dev);
  198. const struct fs_platform_info *fpi = fep->fpi;
  199. fcc_t __iomem *fccp = fep->fcc.fccp;
  200. fcc_c_t __iomem *fcccp = fep->fcc.fcccp;
  201. fcc_enet_t __iomem *ep = fep->fcc.ep;
  202. dma_addr_t rx_bd_base_phys, tx_bd_base_phys;
  203. u16 paddrh, paddrm, paddrl;
  204. const unsigned char *mac;
  205. int i;
  206. C32(fccp, fcc_gfmr, FCC_GFMR_ENR | FCC_GFMR_ENT);
  207. /* clear everything (slow & steady does it) */
  208. for (i = 0; i < sizeof(*ep); i++)
  209. out_8((u8 __iomem *)ep + i, 0);
  210. /* get physical address */
  211. rx_bd_base_phys = fep->ring_mem_addr;
  212. tx_bd_base_phys = rx_bd_base_phys + sizeof(cbd_t) * fpi->rx_ring;
  213. /* point to bds */
  214. W32(ep, fen_genfcc.fcc_rbase, rx_bd_base_phys);
  215. W32(ep, fen_genfcc.fcc_tbase, tx_bd_base_phys);
  216. /* Set maximum bytes per receive buffer.
  217. * It must be a multiple of 32.
  218. */
  219. W16(ep, fen_genfcc.fcc_mrblr, PKT_MAXBLR_SIZE);
  220. W32(ep, fen_genfcc.fcc_rstate, (CPMFCR_GBL | CPMFCR_EB) << 24);
  221. W32(ep, fen_genfcc.fcc_tstate, (CPMFCR_GBL | CPMFCR_EB) << 24);
  222. /* Allocate space in the reserved FCC area of DPRAM for the
  223. * internal buffers. No one uses this space (yet), so we
  224. * can do this. Later, we will add resource management for
  225. * this area.
  226. */
  227. W16(ep, fen_genfcc.fcc_riptr, fpi->dpram_offset);
  228. W16(ep, fen_genfcc.fcc_tiptr, fpi->dpram_offset + 32);
  229. W16(ep, fen_padptr, fpi->dpram_offset + 64);
  230. /* fill with special symbol... */
  231. memset_io(fep->fcc.mem + fpi->dpram_offset + 64, 0x88, 32);
  232. W32(ep, fen_genfcc.fcc_rbptr, 0);
  233. W32(ep, fen_genfcc.fcc_tbptr, 0);
  234. W32(ep, fen_genfcc.fcc_rcrc, 0);
  235. W32(ep, fen_genfcc.fcc_tcrc, 0);
  236. W16(ep, fen_genfcc.fcc_res1, 0);
  237. W32(ep, fen_genfcc.fcc_res2, 0);
  238. /* no CAM */
  239. W32(ep, fen_camptr, 0);
  240. /* Set CRC preset and mask */
  241. W32(ep, fen_cmask, 0xdebb20e3);
  242. W32(ep, fen_cpres, 0xffffffff);
  243. W32(ep, fen_crcec, 0); /* CRC Error counter */
  244. W32(ep, fen_alec, 0); /* alignment error counter */
  245. W32(ep, fen_disfc, 0); /* discard frame counter */
  246. W16(ep, fen_retlim, 15); /* Retry limit threshold */
  247. W16(ep, fen_pper, 0); /* Normal persistence */
  248. /* set group address */
  249. W32(ep, fen_gaddrh, fep->fcc.gaddrh);
  250. W32(ep, fen_gaddrl, fep->fcc.gaddrh);
  251. /* Clear hash filter tables */
  252. W32(ep, fen_iaddrh, 0);
  253. W32(ep, fen_iaddrl, 0);
  254. /* Clear the Out-of-sequence TxBD */
  255. W16(ep, fen_tfcstat, 0);
  256. W16(ep, fen_tfclen, 0);
  257. W32(ep, fen_tfcptr, 0);
  258. W16(ep, fen_mflr, PKT_MAXBUF_SIZE); /* maximum frame length register */
  259. W16(ep, fen_minflr, PKT_MINBUF_SIZE); /* minimum frame length register */
  260. /* set address */
  261. mac = dev->dev_addr;
  262. paddrh = ((u16)mac[5] << 8) | mac[4];
  263. paddrm = ((u16)mac[3] << 8) | mac[2];
  264. paddrl = ((u16)mac[1] << 8) | mac[0];
  265. W16(ep, fen_paddrh, paddrh);
  266. W16(ep, fen_paddrm, paddrm);
  267. W16(ep, fen_paddrl, paddrl);
  268. W16(ep, fen_taddrh, 0);
  269. W16(ep, fen_taddrm, 0);
  270. W16(ep, fen_taddrl, 0);
  271. W16(ep, fen_maxd1, 1520); /* maximum DMA1 length */
  272. W16(ep, fen_maxd2, 1520); /* maximum DMA2 length */
  273. /* Clear stat counters, in case we ever enable RMON */
  274. W32(ep, fen_octc, 0);
  275. W32(ep, fen_colc, 0);
  276. W32(ep, fen_broc, 0);
  277. W32(ep, fen_mulc, 0);
  278. W32(ep, fen_uspc, 0);
  279. W32(ep, fen_frgc, 0);
  280. W32(ep, fen_ospc, 0);
  281. W32(ep, fen_jbrc, 0);
  282. W32(ep, fen_p64c, 0);
  283. W32(ep, fen_p65c, 0);
  284. W32(ep, fen_p128c, 0);
  285. W32(ep, fen_p256c, 0);
  286. W32(ep, fen_p512c, 0);
  287. W32(ep, fen_p1024c, 0);
  288. W16(ep, fen_rfthr, 0); /* Suggested by manual */
  289. W16(ep, fen_rfcnt, 0);
  290. W16(ep, fen_cftype, 0);
  291. fs_init_bds(dev);
  292. /* adjust to speed (for RMII mode) */
  293. if (fpi->use_rmii) {
  294. if (dev->phydev->speed == 100)
  295. C8(fcccp, fcc_gfemr, 0x20);
  296. else
  297. S8(fcccp, fcc_gfemr, 0x20);
  298. }
  299. fcc_cr_cmd(fep, CPM_CR_INIT_TRX);
  300. /* clear events */
  301. W16(fccp, fcc_fcce, 0xffff);
  302. /* Enable interrupts we wish to service */
  303. W16(fccp, fcc_fccm, FCC_ENET_TXE | FCC_ENET_RXF | FCC_ENET_TXB);
  304. /* Set GFMR to enable Ethernet operating mode */
  305. W32(fccp, fcc_gfmr, FCC_GFMR_TCI | FCC_GFMR_MODE_ENET);
  306. /* set sync/delimiters */
  307. W16(fccp, fcc_fdsr, 0xd555);
  308. W32(fccp, fcc_fpsmr, FCC_PSMR_ENCRC);
  309. if (fpi->use_rmii)
  310. S32(fccp, fcc_fpsmr, FCC_PSMR_RMII);
  311. /* adjust to duplex mode */
  312. if (dev->phydev->duplex)
  313. S32(fccp, fcc_fpsmr, FCC_PSMR_FDE | FCC_PSMR_LPB);
  314. else
  315. C32(fccp, fcc_fpsmr, FCC_PSMR_FDE | FCC_PSMR_LPB);
  316. /* Restore multicast and promiscuous settings */
  317. set_multicast_list(dev);
  318. S32(fccp, fcc_gfmr, FCC_GFMR_ENR | FCC_GFMR_ENT);
  319. }
  320. static void stop(struct net_device *dev)
  321. {
  322. struct fs_enet_private *fep = netdev_priv(dev);
  323. fcc_t __iomem *fccp = fep->fcc.fccp;
  324. /* stop ethernet */
  325. C32(fccp, fcc_gfmr, FCC_GFMR_ENR | FCC_GFMR_ENT);
  326. /* clear events */
  327. W16(fccp, fcc_fcce, 0xffff);
  328. /* clear interrupt mask */
  329. W16(fccp, fcc_fccm, 0);
  330. fs_cleanup_bds(dev);
  331. }
  332. static void napi_clear_event_fs(struct net_device *dev)
  333. {
  334. struct fs_enet_private *fep = netdev_priv(dev);
  335. fcc_t __iomem *fccp = fep->fcc.fccp;
  336. W16(fccp, fcc_fcce, FCC_NAPI_EVENT_MSK);
  337. }
  338. static void napi_enable_fs(struct net_device *dev)
  339. {
  340. struct fs_enet_private *fep = netdev_priv(dev);
  341. fcc_t __iomem *fccp = fep->fcc.fccp;
  342. S16(fccp, fcc_fccm, FCC_NAPI_EVENT_MSK);
  343. }
  344. static void napi_disable_fs(struct net_device *dev)
  345. {
  346. struct fs_enet_private *fep = netdev_priv(dev);
  347. fcc_t __iomem *fccp = fep->fcc.fccp;
  348. C16(fccp, fcc_fccm, FCC_NAPI_EVENT_MSK);
  349. }
  350. static void rx_bd_done(struct net_device *dev)
  351. {
  352. /* nothing */
  353. }
  354. static void tx_kickstart(struct net_device *dev)
  355. {
  356. struct fs_enet_private *fep = netdev_priv(dev);
  357. fcc_t __iomem *fccp = fep->fcc.fccp;
  358. S16(fccp, fcc_ftodr, 0x8000);
  359. }
  360. static u32 get_int_events(struct net_device *dev)
  361. {
  362. struct fs_enet_private *fep = netdev_priv(dev);
  363. fcc_t __iomem *fccp = fep->fcc.fccp;
  364. return (u32)R16(fccp, fcc_fcce);
  365. }
  366. static void clear_int_events(struct net_device *dev, u32 int_events)
  367. {
  368. struct fs_enet_private *fep = netdev_priv(dev);
  369. fcc_t __iomem *fccp = fep->fcc.fccp;
  370. W16(fccp, fcc_fcce, int_events & 0xffff);
  371. }
  372. static void ev_error(struct net_device *dev, u32 int_events)
  373. {
  374. struct fs_enet_private *fep = netdev_priv(dev);
  375. dev_warn(fep->dev, "FS_ENET ERROR(s) 0x%x\n", int_events);
  376. }
  377. static int get_regs(struct net_device *dev, void *p, int *sizep)
  378. {
  379. struct fs_enet_private *fep = netdev_priv(dev);
  380. if (*sizep < sizeof(fcc_t) + sizeof(fcc_enet_t) + 1)
  381. return -EINVAL;
  382. memcpy_fromio(p, fep->fcc.fccp, sizeof(fcc_t));
  383. p = (char *)p + sizeof(fcc_t);
  384. memcpy_fromio(p, fep->fcc.ep, sizeof(fcc_enet_t));
  385. p = (char *)p + sizeof(fcc_enet_t);
  386. memcpy_fromio(p, fep->fcc.fcccp, 1);
  387. return 0;
  388. }
  389. static int get_regs_len(struct net_device *dev)
  390. {
  391. return sizeof(fcc_t) + sizeof(fcc_enet_t) + 1;
  392. }
  393. /* Some transmit errors cause the transmitter to shut
  394. * down. We now issue a restart transmit.
  395. * Also, to workaround 8260 device erratum CPM37, we must
  396. * disable and then re-enable the transmitterfollowing a
  397. * Late Collision, Underrun, or Retry Limit error.
  398. * In addition, tbptr may point beyond BDs beyond still marked
  399. * as ready due to internal pipelining, so we need to look back
  400. * through the BDs and adjust tbptr to point to the last BD
  401. * marked as ready. This may result in some buffers being
  402. * retransmitted.
  403. */
  404. static void tx_restart(struct net_device *dev)
  405. {
  406. struct fs_enet_private *fep = netdev_priv(dev);
  407. fcc_t __iomem *fccp = fep->fcc.fccp;
  408. const struct fs_platform_info *fpi = fep->fpi;
  409. fcc_enet_t __iomem *ep = fep->fcc.ep;
  410. cbd_t __iomem *curr_tbptr;
  411. cbd_t __iomem *recheck_bd;
  412. cbd_t __iomem *prev_bd;
  413. cbd_t __iomem *last_tx_bd;
  414. last_tx_bd = fep->tx_bd_base + (fpi->tx_ring - 1);
  415. /* get the current bd held in TBPTR and scan back from this point */
  416. recheck_bd = curr_tbptr = (cbd_t __iomem *)
  417. ((R32(ep, fen_genfcc.fcc_tbptr) - fep->ring_mem_addr) +
  418. fep->ring_base);
  419. prev_bd = (recheck_bd == fep->tx_bd_base) ? last_tx_bd : recheck_bd - 1;
  420. /* Move through the bds in reverse, look for the earliest buffer
  421. * that is not ready. Adjust TBPTR to the following buffer */
  422. while ((CBDR_SC(prev_bd) & BD_ENET_TX_READY) != 0) {
  423. /* Go back one buffer */
  424. recheck_bd = prev_bd;
  425. /* update the previous buffer */
  426. prev_bd = (prev_bd == fep->tx_bd_base) ? last_tx_bd : prev_bd - 1;
  427. /* We should never see all bds marked as ready, check anyway */
  428. if (recheck_bd == curr_tbptr)
  429. break;
  430. }
  431. /* Now update the TBPTR and dirty flag to the current buffer */
  432. W32(ep, fen_genfcc.fcc_tbptr,
  433. (uint) (((void *)recheck_bd - fep->ring_base) +
  434. fep->ring_mem_addr));
  435. fep->dirty_tx = recheck_bd;
  436. C32(fccp, fcc_gfmr, FCC_GFMR_ENT);
  437. udelay(10);
  438. S32(fccp, fcc_gfmr, FCC_GFMR_ENT);
  439. fcc_cr_cmd(fep, CPM_CR_RESTART_TX);
  440. }
  441. /*************************************************************************/
  442. const struct fs_ops fs_fcc_ops = {
  443. .setup_data = setup_data,
  444. .cleanup_data = cleanup_data,
  445. .set_multicast_list = set_multicast_list,
  446. .restart = restart,
  447. .stop = stop,
  448. .napi_clear_event = napi_clear_event_fs,
  449. .napi_enable = napi_enable_fs,
  450. .napi_disable = napi_disable_fs,
  451. .rx_bd_done = rx_bd_done,
  452. .tx_kickstart = tx_kickstart,
  453. .get_int_events = get_int_events,
  454. .clear_int_events = clear_int_events,
  455. .ev_error = ev_error,
  456. .get_regs = get_regs,
  457. .get_regs_len = get_regs_len,
  458. .tx_restart = tx_restart,
  459. .allocate_bd = allocate_bd,
  460. .free_bd = free_bd,
  461. };