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