mac-fcc.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  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 == NO_IRQ)
  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_RX_EVENT_MSK (FCC_ENET_RXF | FCC_ENET_RXB)
  104. #define FCC_RX_EVENT (FCC_ENET_RXF)
  105. #define FCC_TX_EVENT (FCC_ENET_TXB)
  106. #define FCC_ERR_EVENT_MSK (FCC_ENET_TXE)
  107. static int setup_data(struct net_device *dev)
  108. {
  109. struct fs_enet_private *fep = netdev_priv(dev);
  110. if (do_pd_setup(fep) != 0)
  111. return -EINVAL;
  112. fep->ev_napi_rx = FCC_NAPI_RX_EVENT_MSK;
  113. fep->ev_rx = FCC_RX_EVENT;
  114. fep->ev_tx = FCC_TX_EVENT;
  115. fep->ev_err = FCC_ERR_EVENT_MSK;
  116. return 0;
  117. }
  118. static int allocate_bd(struct net_device *dev)
  119. {
  120. struct fs_enet_private *fep = netdev_priv(dev);
  121. const struct fs_platform_info *fpi = fep->fpi;
  122. fep->ring_base = (void __iomem __force *)dma_alloc_coherent(fep->dev,
  123. (fpi->tx_ring + fpi->rx_ring) *
  124. sizeof(cbd_t), &fep->ring_mem_addr,
  125. GFP_KERNEL);
  126. if (fep->ring_base == NULL)
  127. return -ENOMEM;
  128. return 0;
  129. }
  130. static void free_bd(struct net_device *dev)
  131. {
  132. struct fs_enet_private *fep = netdev_priv(dev);
  133. const struct fs_platform_info *fpi = fep->fpi;
  134. if (fep->ring_base)
  135. dma_free_coherent(fep->dev,
  136. (fpi->tx_ring + fpi->rx_ring) * sizeof(cbd_t),
  137. (void __force *)fep->ring_base, fep->ring_mem_addr);
  138. }
  139. static void cleanup_data(struct net_device *dev)
  140. {
  141. /* nothing */
  142. }
  143. static void set_promiscuous_mode(struct net_device *dev)
  144. {
  145. struct fs_enet_private *fep = netdev_priv(dev);
  146. fcc_t __iomem *fccp = fep->fcc.fccp;
  147. S32(fccp, fcc_fpsmr, FCC_PSMR_PRO);
  148. }
  149. static void set_multicast_start(struct net_device *dev)
  150. {
  151. struct fs_enet_private *fep = netdev_priv(dev);
  152. fcc_enet_t __iomem *ep = fep->fcc.ep;
  153. W32(ep, fen_gaddrh, 0);
  154. W32(ep, fen_gaddrl, 0);
  155. }
  156. static void set_multicast_one(struct net_device *dev, const u8 *mac)
  157. {
  158. struct fs_enet_private *fep = netdev_priv(dev);
  159. fcc_enet_t __iomem *ep = fep->fcc.ep;
  160. u16 taddrh, taddrm, taddrl;
  161. taddrh = ((u16)mac[5] << 8) | mac[4];
  162. taddrm = ((u16)mac[3] << 8) | mac[2];
  163. taddrl = ((u16)mac[1] << 8) | mac[0];
  164. W16(ep, fen_taddrh, taddrh);
  165. W16(ep, fen_taddrm, taddrm);
  166. W16(ep, fen_taddrl, taddrl);
  167. fcc_cr_cmd(fep, CPM_CR_SET_GADDR);
  168. }
  169. static void set_multicast_finish(struct net_device *dev)
  170. {
  171. struct fs_enet_private *fep = netdev_priv(dev);
  172. fcc_t __iomem *fccp = fep->fcc.fccp;
  173. fcc_enet_t __iomem *ep = fep->fcc.ep;
  174. /* clear promiscuous always */
  175. C32(fccp, fcc_fpsmr, FCC_PSMR_PRO);
  176. /* if all multi or too many multicasts; just enable all */
  177. if ((dev->flags & IFF_ALLMULTI) != 0 ||
  178. netdev_mc_count(dev) > FCC_MAX_MULTICAST_ADDRS) {
  179. W32(ep, fen_gaddrh, 0xffffffff);
  180. W32(ep, fen_gaddrl, 0xffffffff);
  181. }
  182. /* read back */
  183. fep->fcc.gaddrh = R32(ep, fen_gaddrh);
  184. fep->fcc.gaddrl = R32(ep, fen_gaddrl);
  185. }
  186. static void set_multicast_list(struct net_device *dev)
  187. {
  188. struct netdev_hw_addr *ha;
  189. if ((dev->flags & IFF_PROMISC) == 0) {
  190. set_multicast_start(dev);
  191. netdev_for_each_mc_addr(ha, dev)
  192. set_multicast_one(dev, ha->addr);
  193. set_multicast_finish(dev);
  194. } else
  195. set_promiscuous_mode(dev);
  196. }
  197. static void restart(struct net_device *dev)
  198. {
  199. struct fs_enet_private *fep = netdev_priv(dev);
  200. const struct fs_platform_info *fpi = fep->fpi;
  201. fcc_t __iomem *fccp = fep->fcc.fccp;
  202. fcc_c_t __iomem *fcccp = fep->fcc.fcccp;
  203. fcc_enet_t __iomem *ep = fep->fcc.ep;
  204. dma_addr_t rx_bd_base_phys, tx_bd_base_phys;
  205. u16 paddrh, paddrm, paddrl;
  206. const unsigned char *mac;
  207. int i;
  208. C32(fccp, fcc_gfmr, FCC_GFMR_ENR | FCC_GFMR_ENT);
  209. /* clear everything (slow & steady does it) */
  210. for (i = 0; i < sizeof(*ep); i++)
  211. out_8((u8 __iomem *)ep + i, 0);
  212. /* get physical address */
  213. rx_bd_base_phys = fep->ring_mem_addr;
  214. tx_bd_base_phys = rx_bd_base_phys + sizeof(cbd_t) * fpi->rx_ring;
  215. /* point to bds */
  216. W32(ep, fen_genfcc.fcc_rbase, rx_bd_base_phys);
  217. W32(ep, fen_genfcc.fcc_tbase, tx_bd_base_phys);
  218. /* Set maximum bytes per receive buffer.
  219. * It must be a multiple of 32.
  220. */
  221. W16(ep, fen_genfcc.fcc_mrblr, PKT_MAXBLR_SIZE);
  222. W32(ep, fen_genfcc.fcc_rstate, (CPMFCR_GBL | CPMFCR_EB) << 24);
  223. W32(ep, fen_genfcc.fcc_tstate, (CPMFCR_GBL | CPMFCR_EB) << 24);
  224. /* Allocate space in the reserved FCC area of DPRAM for the
  225. * internal buffers. No one uses this space (yet), so we
  226. * can do this. Later, we will add resource management for
  227. * this area.
  228. */
  229. W16(ep, fen_genfcc.fcc_riptr, fpi->dpram_offset);
  230. W16(ep, fen_genfcc.fcc_tiptr, fpi->dpram_offset + 32);
  231. W16(ep, fen_padptr, fpi->dpram_offset + 64);
  232. /* fill with special symbol... */
  233. memset_io(fep->fcc.mem + fpi->dpram_offset + 64, 0x88, 32);
  234. W32(ep, fen_genfcc.fcc_rbptr, 0);
  235. W32(ep, fen_genfcc.fcc_tbptr, 0);
  236. W32(ep, fen_genfcc.fcc_rcrc, 0);
  237. W32(ep, fen_genfcc.fcc_tcrc, 0);
  238. W16(ep, fen_genfcc.fcc_res1, 0);
  239. W32(ep, fen_genfcc.fcc_res2, 0);
  240. /* no CAM */
  241. W32(ep, fen_camptr, 0);
  242. /* Set CRC preset and mask */
  243. W32(ep, fen_cmask, 0xdebb20e3);
  244. W32(ep, fen_cpres, 0xffffffff);
  245. W32(ep, fen_crcec, 0); /* CRC Error counter */
  246. W32(ep, fen_alec, 0); /* alignment error counter */
  247. W32(ep, fen_disfc, 0); /* discard frame counter */
  248. W16(ep, fen_retlim, 15); /* Retry limit threshold */
  249. W16(ep, fen_pper, 0); /* Normal persistence */
  250. /* set group address */
  251. W32(ep, fen_gaddrh, fep->fcc.gaddrh);
  252. W32(ep, fen_gaddrl, fep->fcc.gaddrh);
  253. /* Clear hash filter tables */
  254. W32(ep, fen_iaddrh, 0);
  255. W32(ep, fen_iaddrl, 0);
  256. /* Clear the Out-of-sequence TxBD */
  257. W16(ep, fen_tfcstat, 0);
  258. W16(ep, fen_tfclen, 0);
  259. W32(ep, fen_tfcptr, 0);
  260. W16(ep, fen_mflr, PKT_MAXBUF_SIZE); /* maximum frame length register */
  261. W16(ep, fen_minflr, PKT_MINBUF_SIZE); /* minimum frame length register */
  262. /* set address */
  263. mac = dev->dev_addr;
  264. paddrh = ((u16)mac[5] << 8) | mac[4];
  265. paddrm = ((u16)mac[3] << 8) | mac[2];
  266. paddrl = ((u16)mac[1] << 8) | mac[0];
  267. W16(ep, fen_paddrh, paddrh);
  268. W16(ep, fen_paddrm, paddrm);
  269. W16(ep, fen_paddrl, paddrl);
  270. W16(ep, fen_taddrh, 0);
  271. W16(ep, fen_taddrm, 0);
  272. W16(ep, fen_taddrl, 0);
  273. W16(ep, fen_maxd1, 1520); /* maximum DMA1 length */
  274. W16(ep, fen_maxd2, 1520); /* maximum DMA2 length */
  275. /* Clear stat counters, in case we ever enable RMON */
  276. W32(ep, fen_octc, 0);
  277. W32(ep, fen_colc, 0);
  278. W32(ep, fen_broc, 0);
  279. W32(ep, fen_mulc, 0);
  280. W32(ep, fen_uspc, 0);
  281. W32(ep, fen_frgc, 0);
  282. W32(ep, fen_ospc, 0);
  283. W32(ep, fen_jbrc, 0);
  284. W32(ep, fen_p64c, 0);
  285. W32(ep, fen_p65c, 0);
  286. W32(ep, fen_p128c, 0);
  287. W32(ep, fen_p256c, 0);
  288. W32(ep, fen_p512c, 0);
  289. W32(ep, fen_p1024c, 0);
  290. W16(ep, fen_rfthr, 0); /* Suggested by manual */
  291. W16(ep, fen_rfcnt, 0);
  292. W16(ep, fen_cftype, 0);
  293. fs_init_bds(dev);
  294. /* adjust to speed (for RMII mode) */
  295. if (fpi->use_rmii) {
  296. if (fep->phydev->speed == 100)
  297. C8(fcccp, fcc_gfemr, 0x20);
  298. else
  299. S8(fcccp, fcc_gfemr, 0x20);
  300. }
  301. fcc_cr_cmd(fep, CPM_CR_INIT_TRX);
  302. /* clear events */
  303. W16(fccp, fcc_fcce, 0xffff);
  304. /* Enable interrupts we wish to service */
  305. W16(fccp, fcc_fccm, FCC_ENET_TXE | FCC_ENET_RXF | FCC_ENET_TXB);
  306. /* Set GFMR to enable Ethernet operating mode */
  307. W32(fccp, fcc_gfmr, FCC_GFMR_TCI | FCC_GFMR_MODE_ENET);
  308. /* set sync/delimiters */
  309. W16(fccp, fcc_fdsr, 0xd555);
  310. W32(fccp, fcc_fpsmr, FCC_PSMR_ENCRC);
  311. if (fpi->use_rmii)
  312. S32(fccp, fcc_fpsmr, FCC_PSMR_RMII);
  313. /* adjust to duplex mode */
  314. if (fep->phydev->duplex)
  315. S32(fccp, fcc_fpsmr, FCC_PSMR_FDE | FCC_PSMR_LPB);
  316. else
  317. C32(fccp, fcc_fpsmr, FCC_PSMR_FDE | FCC_PSMR_LPB);
  318. /* Restore multicast and promiscuous settings */
  319. set_multicast_list(dev);
  320. S32(fccp, fcc_gfmr, FCC_GFMR_ENR | FCC_GFMR_ENT);
  321. }
  322. static void stop(struct net_device *dev)
  323. {
  324. struct fs_enet_private *fep = netdev_priv(dev);
  325. fcc_t __iomem *fccp = fep->fcc.fccp;
  326. /* stop ethernet */
  327. C32(fccp, fcc_gfmr, FCC_GFMR_ENR | FCC_GFMR_ENT);
  328. /* clear events */
  329. W16(fccp, fcc_fcce, 0xffff);
  330. /* clear interrupt mask */
  331. W16(fccp, fcc_fccm, 0);
  332. fs_cleanup_bds(dev);
  333. }
  334. static void napi_clear_rx_event(struct net_device *dev)
  335. {
  336. struct fs_enet_private *fep = netdev_priv(dev);
  337. fcc_t __iomem *fccp = fep->fcc.fccp;
  338. W16(fccp, fcc_fcce, FCC_NAPI_RX_EVENT_MSK);
  339. }
  340. static void napi_enable_rx(struct net_device *dev)
  341. {
  342. struct fs_enet_private *fep = netdev_priv(dev);
  343. fcc_t __iomem *fccp = fep->fcc.fccp;
  344. S16(fccp, fcc_fccm, FCC_NAPI_RX_EVENT_MSK);
  345. }
  346. static void napi_disable_rx(struct net_device *dev)
  347. {
  348. struct fs_enet_private *fep = netdev_priv(dev);
  349. fcc_t __iomem *fccp = fep->fcc.fccp;
  350. C16(fccp, fcc_fccm, FCC_NAPI_RX_EVENT_MSK);
  351. }
  352. static void rx_bd_done(struct net_device *dev)
  353. {
  354. /* nothing */
  355. }
  356. static void tx_kickstart(struct net_device *dev)
  357. {
  358. struct fs_enet_private *fep = netdev_priv(dev);
  359. fcc_t __iomem *fccp = fep->fcc.fccp;
  360. S16(fccp, fcc_ftodr, 0x8000);
  361. }
  362. static u32 get_int_events(struct net_device *dev)
  363. {
  364. struct fs_enet_private *fep = netdev_priv(dev);
  365. fcc_t __iomem *fccp = fep->fcc.fccp;
  366. return (u32)R16(fccp, fcc_fcce);
  367. }
  368. static void clear_int_events(struct net_device *dev, u32 int_events)
  369. {
  370. struct fs_enet_private *fep = netdev_priv(dev);
  371. fcc_t __iomem *fccp = fep->fcc.fccp;
  372. W16(fccp, fcc_fcce, int_events & 0xffff);
  373. }
  374. static void ev_error(struct net_device *dev, u32 int_events)
  375. {
  376. struct fs_enet_private *fep = netdev_priv(dev);
  377. dev_warn(fep->dev, "FS_ENET ERROR(s) 0x%x\n", int_events);
  378. }
  379. static int get_regs(struct net_device *dev, void *p, int *sizep)
  380. {
  381. struct fs_enet_private *fep = netdev_priv(dev);
  382. if (*sizep < sizeof(fcc_t) + sizeof(fcc_enet_t) + 1)
  383. return -EINVAL;
  384. memcpy_fromio(p, fep->fcc.fccp, sizeof(fcc_t));
  385. p = (char *)p + sizeof(fcc_t);
  386. memcpy_fromio(p, fep->fcc.ep, sizeof(fcc_enet_t));
  387. p = (char *)p + sizeof(fcc_enet_t);
  388. memcpy_fromio(p, fep->fcc.fcccp, 1);
  389. return 0;
  390. }
  391. static int get_regs_len(struct net_device *dev)
  392. {
  393. return sizeof(fcc_t) + sizeof(fcc_enet_t) + 1;
  394. }
  395. /* Some transmit errors cause the transmitter to shut
  396. * down. We now issue a restart transmit.
  397. * Also, to workaround 8260 device erratum CPM37, we must
  398. * disable and then re-enable the transmitterfollowing a
  399. * Late Collision, Underrun, or Retry Limit error.
  400. * In addition, tbptr may point beyond BDs beyond still marked
  401. * as ready due to internal pipelining, so we need to look back
  402. * through the BDs and adjust tbptr to point to the last BD
  403. * marked as ready. This may result in some buffers being
  404. * retransmitted.
  405. */
  406. static void tx_restart(struct net_device *dev)
  407. {
  408. struct fs_enet_private *fep = netdev_priv(dev);
  409. fcc_t __iomem *fccp = fep->fcc.fccp;
  410. const struct fs_platform_info *fpi = fep->fpi;
  411. fcc_enet_t __iomem *ep = fep->fcc.ep;
  412. cbd_t __iomem *curr_tbptr;
  413. cbd_t __iomem *recheck_bd;
  414. cbd_t __iomem *prev_bd;
  415. cbd_t __iomem *last_tx_bd;
  416. last_tx_bd = fep->tx_bd_base + (fpi->tx_ring * sizeof(cbd_t));
  417. /* get the current bd held in TBPTR and scan back from this point */
  418. recheck_bd = curr_tbptr = (cbd_t __iomem *)
  419. ((R32(ep, fen_genfcc.fcc_tbptr) - fep->ring_mem_addr) +
  420. fep->ring_base);
  421. prev_bd = (recheck_bd == fep->tx_bd_base) ? last_tx_bd : recheck_bd - 1;
  422. /* Move through the bds in reverse, look for the earliest buffer
  423. * that is not ready. Adjust TBPTR to the following buffer */
  424. while ((CBDR_SC(prev_bd) & BD_ENET_TX_READY) != 0) {
  425. /* Go back one buffer */
  426. recheck_bd = prev_bd;
  427. /* update the previous buffer */
  428. prev_bd = (prev_bd == fep->tx_bd_base) ? last_tx_bd : prev_bd - 1;
  429. /* We should never see all bds marked as ready, check anyway */
  430. if (recheck_bd == curr_tbptr)
  431. break;
  432. }
  433. /* Now update the TBPTR and dirty flag to the current buffer */
  434. W32(ep, fen_genfcc.fcc_tbptr,
  435. (uint) (((void *)recheck_bd - fep->ring_base) +
  436. fep->ring_mem_addr));
  437. fep->dirty_tx = recheck_bd;
  438. C32(fccp, fcc_gfmr, FCC_GFMR_ENT);
  439. udelay(10);
  440. S32(fccp, fcc_gfmr, FCC_GFMR_ENT);
  441. fcc_cr_cmd(fep, CPM_CR_RESTART_TX);
  442. }
  443. /*************************************************************************/
  444. const struct fs_ops fs_fcc_ops = {
  445. .setup_data = setup_data,
  446. .cleanup_data = cleanup_data,
  447. .set_multicast_list = set_multicast_list,
  448. .restart = restart,
  449. .stop = stop,
  450. .napi_clear_rx_event = napi_clear_rx_event,
  451. .napi_enable_rx = napi_enable_rx,
  452. .napi_disable_rx = napi_disable_rx,
  453. .rx_bd_done = rx_bd_done,
  454. .tx_kickstart = tx_kickstart,
  455. .get_int_events = get_int_events,
  456. .clear_int_events = clear_int_events,
  457. .ev_error = ev_error,
  458. .get_regs = get_regs,
  459. .get_regs_len = get_regs_len,
  460. .tx_restart = tx_restart,
  461. .allocate_bd = allocate_bd,
  462. .free_bd = free_bd,
  463. };