moxart_ether.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. /* MOXA ART Ethernet (RTL8201CP) driver.
  2. *
  3. * Copyright (C) 2013 Jonas Jensen
  4. *
  5. * Jonas Jensen <jonas.jensen@gmail.com>
  6. *
  7. * Based on code from
  8. * Moxa Technology Co., Ltd. <www.moxa.com>
  9. *
  10. * This file is licensed under the terms of the GNU General Public
  11. * License version 2. This program is licensed "as is" without any
  12. * warranty of any kind, whether express or implied.
  13. */
  14. #include <linux/module.h>
  15. #include <linux/netdevice.h>
  16. #include <linux/etherdevice.h>
  17. #include <linux/skbuff.h>
  18. #include <linux/dma-mapping.h>
  19. #include <linux/ethtool.h>
  20. #include <linux/platform_device.h>
  21. #include <linux/interrupt.h>
  22. #include <linux/irq.h>
  23. #include <linux/of_address.h>
  24. #include <linux/of_irq.h>
  25. #include <linux/crc32.h>
  26. #include <linux/crc32c.h>
  27. #include <linux/circ_buf.h>
  28. #include "moxart_ether.h"
  29. static inline void moxart_desc_write(u32 data, u32 *desc)
  30. {
  31. *desc = cpu_to_le32(data);
  32. }
  33. static inline u32 moxart_desc_read(u32 *desc)
  34. {
  35. return le32_to_cpu(*desc);
  36. }
  37. static inline void moxart_emac_write(struct net_device *ndev,
  38. unsigned int reg, unsigned long value)
  39. {
  40. struct moxart_mac_priv_t *priv = netdev_priv(ndev);
  41. writel(value, priv->base + reg);
  42. }
  43. static void moxart_update_mac_address(struct net_device *ndev)
  44. {
  45. moxart_emac_write(ndev, REG_MAC_MS_ADDRESS,
  46. ((ndev->dev_addr[0] << 8) | (ndev->dev_addr[1])));
  47. moxart_emac_write(ndev, REG_MAC_MS_ADDRESS + 4,
  48. ((ndev->dev_addr[2] << 24) |
  49. (ndev->dev_addr[3] << 16) |
  50. (ndev->dev_addr[4] << 8) |
  51. (ndev->dev_addr[5])));
  52. }
  53. static int moxart_set_mac_address(struct net_device *ndev, void *addr)
  54. {
  55. struct sockaddr *address = addr;
  56. if (!is_valid_ether_addr(address->sa_data))
  57. return -EADDRNOTAVAIL;
  58. memcpy(ndev->dev_addr, address->sa_data, ndev->addr_len);
  59. moxart_update_mac_address(ndev);
  60. return 0;
  61. }
  62. static void moxart_mac_free_memory(struct net_device *ndev)
  63. {
  64. struct moxart_mac_priv_t *priv = netdev_priv(ndev);
  65. int i;
  66. for (i = 0; i < RX_DESC_NUM; i++)
  67. dma_unmap_single(&ndev->dev, priv->rx_mapping[i],
  68. priv->rx_buf_size, DMA_FROM_DEVICE);
  69. if (priv->tx_desc_base)
  70. dma_free_coherent(NULL, TX_REG_DESC_SIZE * TX_DESC_NUM,
  71. priv->tx_desc_base, priv->tx_base);
  72. if (priv->rx_desc_base)
  73. dma_free_coherent(NULL, RX_REG_DESC_SIZE * RX_DESC_NUM,
  74. priv->rx_desc_base, priv->rx_base);
  75. kfree(priv->tx_buf_base);
  76. kfree(priv->rx_buf_base);
  77. }
  78. static void moxart_mac_reset(struct net_device *ndev)
  79. {
  80. struct moxart_mac_priv_t *priv = netdev_priv(ndev);
  81. writel(SW_RST, priv->base + REG_MAC_CTRL);
  82. while (readl(priv->base + REG_MAC_CTRL) & SW_RST)
  83. mdelay(10);
  84. writel(0, priv->base + REG_INTERRUPT_MASK);
  85. priv->reg_maccr = RX_BROADPKT | FULLDUP | CRC_APD | RX_FTL;
  86. }
  87. static void moxart_mac_enable(struct net_device *ndev)
  88. {
  89. struct moxart_mac_priv_t *priv = netdev_priv(ndev);
  90. writel(0x00001010, priv->base + REG_INT_TIMER_CTRL);
  91. writel(0x00000001, priv->base + REG_APOLL_TIMER_CTRL);
  92. writel(0x00000390, priv->base + REG_DMA_BLEN_CTRL);
  93. priv->reg_imr |= (RPKT_FINISH_M | XPKT_FINISH_M);
  94. writel(priv->reg_imr, priv->base + REG_INTERRUPT_MASK);
  95. priv->reg_maccr |= (RCV_EN | XMT_EN | RDMA_EN | XDMA_EN);
  96. writel(priv->reg_maccr, priv->base + REG_MAC_CTRL);
  97. }
  98. static void moxart_mac_setup_desc_ring(struct net_device *ndev)
  99. {
  100. struct moxart_mac_priv_t *priv = netdev_priv(ndev);
  101. void *desc;
  102. int i;
  103. for (i = 0; i < TX_DESC_NUM; i++) {
  104. desc = priv->tx_desc_base + i * TX_REG_DESC_SIZE;
  105. memset(desc, 0, TX_REG_DESC_SIZE);
  106. priv->tx_buf[i] = priv->tx_buf_base + priv->tx_buf_size * i;
  107. }
  108. moxart_desc_write(TX_DESC1_END, desc + TX_REG_OFFSET_DESC1);
  109. priv->tx_head = 0;
  110. priv->tx_tail = 0;
  111. for (i = 0; i < RX_DESC_NUM; i++) {
  112. desc = priv->rx_desc_base + i * RX_REG_DESC_SIZE;
  113. memset(desc, 0, RX_REG_DESC_SIZE);
  114. moxart_desc_write(RX_DESC0_DMA_OWN, desc + RX_REG_OFFSET_DESC0);
  115. moxart_desc_write(RX_BUF_SIZE & RX_DESC1_BUF_SIZE_MASK,
  116. desc + RX_REG_OFFSET_DESC1);
  117. priv->rx_buf[i] = priv->rx_buf_base + priv->rx_buf_size * i;
  118. priv->rx_mapping[i] = dma_map_single(&ndev->dev,
  119. priv->rx_buf[i],
  120. priv->rx_buf_size,
  121. DMA_FROM_DEVICE);
  122. if (dma_mapping_error(&ndev->dev, priv->rx_mapping[i]))
  123. netdev_err(ndev, "DMA mapping error\n");
  124. moxart_desc_write(priv->rx_mapping[i],
  125. desc + RX_REG_OFFSET_DESC2 + RX_DESC2_ADDRESS_PHYS);
  126. moxart_desc_write((uintptr_t)priv->rx_buf[i],
  127. desc + RX_REG_OFFSET_DESC2 + RX_DESC2_ADDRESS_VIRT);
  128. }
  129. moxart_desc_write(RX_DESC1_END, desc + RX_REG_OFFSET_DESC1);
  130. priv->rx_head = 0;
  131. /* reset the MAC controller TX/RX descriptor base address */
  132. writel(priv->tx_base, priv->base + REG_TXR_BASE_ADDRESS);
  133. writel(priv->rx_base, priv->base + REG_RXR_BASE_ADDRESS);
  134. }
  135. static int moxart_mac_open(struct net_device *ndev)
  136. {
  137. struct moxart_mac_priv_t *priv = netdev_priv(ndev);
  138. if (!is_valid_ether_addr(ndev->dev_addr))
  139. return -EADDRNOTAVAIL;
  140. napi_enable(&priv->napi);
  141. moxart_mac_reset(ndev);
  142. moxart_update_mac_address(ndev);
  143. moxart_mac_setup_desc_ring(ndev);
  144. moxart_mac_enable(ndev);
  145. netif_start_queue(ndev);
  146. netdev_dbg(ndev, "%s: IMR=0x%x, MACCR=0x%x\n",
  147. __func__, readl(priv->base + REG_INTERRUPT_MASK),
  148. readl(priv->base + REG_MAC_CTRL));
  149. return 0;
  150. }
  151. static int moxart_mac_stop(struct net_device *ndev)
  152. {
  153. struct moxart_mac_priv_t *priv = netdev_priv(ndev);
  154. napi_disable(&priv->napi);
  155. netif_stop_queue(ndev);
  156. /* disable all interrupts */
  157. writel(0, priv->base + REG_INTERRUPT_MASK);
  158. /* disable all functions */
  159. writel(0, priv->base + REG_MAC_CTRL);
  160. return 0;
  161. }
  162. static int moxart_rx_poll(struct napi_struct *napi, int budget)
  163. {
  164. struct moxart_mac_priv_t *priv = container_of(napi,
  165. struct moxart_mac_priv_t,
  166. napi);
  167. struct net_device *ndev = priv->ndev;
  168. struct sk_buff *skb;
  169. void *desc;
  170. unsigned int desc0, len;
  171. int rx_head = priv->rx_head;
  172. int rx = 0;
  173. while (rx < budget) {
  174. desc = priv->rx_desc_base + (RX_REG_DESC_SIZE * rx_head);
  175. desc0 = moxart_desc_read(desc + RX_REG_OFFSET_DESC0);
  176. rmb(); /* ensure desc0 is up to date */
  177. if (desc0 & RX_DESC0_DMA_OWN)
  178. break;
  179. if (desc0 & (RX_DESC0_ERR | RX_DESC0_CRC_ERR | RX_DESC0_FTL |
  180. RX_DESC0_RUNT | RX_DESC0_ODD_NB)) {
  181. net_dbg_ratelimited("packet error\n");
  182. ndev->stats.rx_dropped++;
  183. ndev->stats.rx_errors++;
  184. goto rx_next;
  185. }
  186. len = desc0 & RX_DESC0_FRAME_LEN_MASK;
  187. if (len > RX_BUF_SIZE)
  188. len = RX_BUF_SIZE;
  189. dma_sync_single_for_cpu(&ndev->dev,
  190. priv->rx_mapping[rx_head],
  191. priv->rx_buf_size, DMA_FROM_DEVICE);
  192. skb = netdev_alloc_skb_ip_align(ndev, len);
  193. if (unlikely(!skb)) {
  194. net_dbg_ratelimited("netdev_alloc_skb_ip_align failed\n");
  195. ndev->stats.rx_dropped++;
  196. ndev->stats.rx_errors++;
  197. goto rx_next;
  198. }
  199. memcpy(skb->data, priv->rx_buf[rx_head], len);
  200. skb_put(skb, len);
  201. skb->protocol = eth_type_trans(skb, ndev);
  202. napi_gro_receive(&priv->napi, skb);
  203. rx++;
  204. ndev->stats.rx_packets++;
  205. ndev->stats.rx_bytes += len;
  206. if (desc0 & RX_DESC0_MULTICAST)
  207. ndev->stats.multicast++;
  208. rx_next:
  209. wmb(); /* prevent setting ownership back too early */
  210. moxart_desc_write(RX_DESC0_DMA_OWN, desc + RX_REG_OFFSET_DESC0);
  211. rx_head = RX_NEXT(rx_head);
  212. priv->rx_head = rx_head;
  213. }
  214. if (rx < budget)
  215. napi_complete_done(napi, rx);
  216. priv->reg_imr |= RPKT_FINISH_M;
  217. writel(priv->reg_imr, priv->base + REG_INTERRUPT_MASK);
  218. return rx;
  219. }
  220. static int moxart_tx_queue_space(struct net_device *ndev)
  221. {
  222. struct moxart_mac_priv_t *priv = netdev_priv(ndev);
  223. return CIRC_SPACE(priv->tx_head, priv->tx_tail, TX_DESC_NUM);
  224. }
  225. static void moxart_tx_finished(struct net_device *ndev)
  226. {
  227. struct moxart_mac_priv_t *priv = netdev_priv(ndev);
  228. unsigned int tx_head = priv->tx_head;
  229. unsigned int tx_tail = priv->tx_tail;
  230. while (tx_tail != tx_head) {
  231. dma_unmap_single(&ndev->dev, priv->tx_mapping[tx_tail],
  232. priv->tx_len[tx_tail], DMA_TO_DEVICE);
  233. ndev->stats.tx_packets++;
  234. ndev->stats.tx_bytes += priv->tx_skb[tx_tail]->len;
  235. dev_kfree_skb_irq(priv->tx_skb[tx_tail]);
  236. priv->tx_skb[tx_tail] = NULL;
  237. tx_tail = TX_NEXT(tx_tail);
  238. }
  239. priv->tx_tail = tx_tail;
  240. if (netif_queue_stopped(ndev) &&
  241. moxart_tx_queue_space(ndev) >= TX_WAKE_THRESHOLD)
  242. netif_wake_queue(ndev);
  243. }
  244. static irqreturn_t moxart_mac_interrupt(int irq, void *dev_id)
  245. {
  246. struct net_device *ndev = (struct net_device *)dev_id;
  247. struct moxart_mac_priv_t *priv = netdev_priv(ndev);
  248. unsigned int ists = readl(priv->base + REG_INTERRUPT_STATUS);
  249. if (ists & XPKT_OK_INT_STS)
  250. moxart_tx_finished(ndev);
  251. if (ists & RPKT_FINISH) {
  252. if (napi_schedule_prep(&priv->napi)) {
  253. priv->reg_imr &= ~RPKT_FINISH_M;
  254. writel(priv->reg_imr, priv->base + REG_INTERRUPT_MASK);
  255. __napi_schedule(&priv->napi);
  256. }
  257. }
  258. return IRQ_HANDLED;
  259. }
  260. static int moxart_mac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
  261. {
  262. struct moxart_mac_priv_t *priv = netdev_priv(ndev);
  263. void *desc;
  264. unsigned int len;
  265. unsigned int tx_head;
  266. u32 txdes1;
  267. int ret = NETDEV_TX_BUSY;
  268. spin_lock_irq(&priv->txlock);
  269. tx_head = priv->tx_head;
  270. desc = priv->tx_desc_base + (TX_REG_DESC_SIZE * tx_head);
  271. if (moxart_tx_queue_space(ndev) == 1)
  272. netif_stop_queue(ndev);
  273. if (moxart_desc_read(desc + TX_REG_OFFSET_DESC0) & TX_DESC0_DMA_OWN) {
  274. net_dbg_ratelimited("no TX space for packet\n");
  275. ndev->stats.tx_dropped++;
  276. goto out_unlock;
  277. }
  278. rmb(); /* ensure data is only read that had TX_DESC0_DMA_OWN cleared */
  279. len = skb->len > TX_BUF_SIZE ? TX_BUF_SIZE : skb->len;
  280. priv->tx_mapping[tx_head] = dma_map_single(&ndev->dev, skb->data,
  281. len, DMA_TO_DEVICE);
  282. if (dma_mapping_error(&ndev->dev, priv->tx_mapping[tx_head])) {
  283. netdev_err(ndev, "DMA mapping error\n");
  284. goto out_unlock;
  285. }
  286. priv->tx_len[tx_head] = len;
  287. priv->tx_skb[tx_head] = skb;
  288. moxart_desc_write(priv->tx_mapping[tx_head],
  289. desc + TX_REG_OFFSET_DESC2 + TX_DESC2_ADDRESS_PHYS);
  290. moxart_desc_write((uintptr_t)skb->data,
  291. desc + TX_REG_OFFSET_DESC2 + TX_DESC2_ADDRESS_VIRT);
  292. if (skb->len < ETH_ZLEN) {
  293. memset(&skb->data[skb->len],
  294. 0, ETH_ZLEN - skb->len);
  295. len = ETH_ZLEN;
  296. }
  297. dma_sync_single_for_device(&ndev->dev, priv->tx_mapping[tx_head],
  298. priv->tx_buf_size, DMA_TO_DEVICE);
  299. txdes1 = TX_DESC1_LTS | TX_DESC1_FTS | (len & TX_DESC1_BUF_SIZE_MASK);
  300. if (tx_head == TX_DESC_NUM_MASK)
  301. txdes1 |= TX_DESC1_END;
  302. moxart_desc_write(txdes1, desc + TX_REG_OFFSET_DESC1);
  303. wmb(); /* flush descriptor before transferring ownership */
  304. moxart_desc_write(TX_DESC0_DMA_OWN, desc + TX_REG_OFFSET_DESC0);
  305. /* start to send packet */
  306. writel(0xffffffff, priv->base + REG_TX_POLL_DEMAND);
  307. priv->tx_head = TX_NEXT(tx_head);
  308. netif_trans_update(ndev);
  309. ret = NETDEV_TX_OK;
  310. out_unlock:
  311. spin_unlock_irq(&priv->txlock);
  312. return ret;
  313. }
  314. static void moxart_mac_setmulticast(struct net_device *ndev)
  315. {
  316. struct moxart_mac_priv_t *priv = netdev_priv(ndev);
  317. struct netdev_hw_addr *ha;
  318. int crc_val;
  319. netdev_for_each_mc_addr(ha, ndev) {
  320. crc_val = crc32_le(~0, ha->addr, ETH_ALEN);
  321. crc_val = (crc_val >> 26) & 0x3f;
  322. if (crc_val >= 32) {
  323. writel(readl(priv->base + REG_MCAST_HASH_TABLE1) |
  324. (1UL << (crc_val - 32)),
  325. priv->base + REG_MCAST_HASH_TABLE1);
  326. } else {
  327. writel(readl(priv->base + REG_MCAST_HASH_TABLE0) |
  328. (1UL << crc_val),
  329. priv->base + REG_MCAST_HASH_TABLE0);
  330. }
  331. }
  332. }
  333. static void moxart_mac_set_rx_mode(struct net_device *ndev)
  334. {
  335. struct moxart_mac_priv_t *priv = netdev_priv(ndev);
  336. spin_lock_irq(&priv->txlock);
  337. (ndev->flags & IFF_PROMISC) ? (priv->reg_maccr |= RCV_ALL) :
  338. (priv->reg_maccr &= ~RCV_ALL);
  339. (ndev->flags & IFF_ALLMULTI) ? (priv->reg_maccr |= RX_MULTIPKT) :
  340. (priv->reg_maccr &= ~RX_MULTIPKT);
  341. if ((ndev->flags & IFF_MULTICAST) && netdev_mc_count(ndev)) {
  342. priv->reg_maccr |= HT_MULTI_EN;
  343. moxart_mac_setmulticast(ndev);
  344. } else {
  345. priv->reg_maccr &= ~HT_MULTI_EN;
  346. }
  347. writel(priv->reg_maccr, priv->base + REG_MAC_CTRL);
  348. spin_unlock_irq(&priv->txlock);
  349. }
  350. static const struct net_device_ops moxart_netdev_ops = {
  351. .ndo_open = moxart_mac_open,
  352. .ndo_stop = moxart_mac_stop,
  353. .ndo_start_xmit = moxart_mac_start_xmit,
  354. .ndo_set_rx_mode = moxart_mac_set_rx_mode,
  355. .ndo_set_mac_address = moxart_set_mac_address,
  356. .ndo_validate_addr = eth_validate_addr,
  357. };
  358. static int moxart_mac_probe(struct platform_device *pdev)
  359. {
  360. struct device *p_dev = &pdev->dev;
  361. struct device_node *node = p_dev->of_node;
  362. struct net_device *ndev;
  363. struct moxart_mac_priv_t *priv;
  364. struct resource *res;
  365. unsigned int irq;
  366. int ret;
  367. ndev = alloc_etherdev(sizeof(struct moxart_mac_priv_t));
  368. if (!ndev)
  369. return -ENOMEM;
  370. irq = irq_of_parse_and_map(node, 0);
  371. if (irq <= 0) {
  372. netdev_err(ndev, "irq_of_parse_and_map failed\n");
  373. ret = -EINVAL;
  374. goto irq_map_fail;
  375. }
  376. priv = netdev_priv(ndev);
  377. priv->ndev = ndev;
  378. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  379. ndev->base_addr = res->start;
  380. priv->base = devm_ioremap_resource(p_dev, res);
  381. if (IS_ERR(priv->base)) {
  382. dev_err(p_dev, "devm_ioremap_resource failed\n");
  383. ret = PTR_ERR(priv->base);
  384. goto init_fail;
  385. }
  386. spin_lock_init(&priv->txlock);
  387. priv->tx_buf_size = TX_BUF_SIZE;
  388. priv->rx_buf_size = RX_BUF_SIZE;
  389. priv->tx_desc_base = dma_alloc_coherent(NULL, TX_REG_DESC_SIZE *
  390. TX_DESC_NUM, &priv->tx_base,
  391. GFP_DMA | GFP_KERNEL);
  392. if (!priv->tx_desc_base) {
  393. ret = -ENOMEM;
  394. goto init_fail;
  395. }
  396. priv->rx_desc_base = dma_alloc_coherent(NULL, RX_REG_DESC_SIZE *
  397. RX_DESC_NUM, &priv->rx_base,
  398. GFP_DMA | GFP_KERNEL);
  399. if (!priv->rx_desc_base) {
  400. ret = -ENOMEM;
  401. goto init_fail;
  402. }
  403. priv->tx_buf_base = kmalloc_array(priv->tx_buf_size, TX_DESC_NUM,
  404. GFP_ATOMIC);
  405. if (!priv->tx_buf_base) {
  406. ret = -ENOMEM;
  407. goto init_fail;
  408. }
  409. priv->rx_buf_base = kmalloc_array(priv->rx_buf_size, RX_DESC_NUM,
  410. GFP_ATOMIC);
  411. if (!priv->rx_buf_base) {
  412. ret = -ENOMEM;
  413. goto init_fail;
  414. }
  415. platform_set_drvdata(pdev, ndev);
  416. ret = devm_request_irq(p_dev, irq, moxart_mac_interrupt, 0,
  417. pdev->name, ndev);
  418. if (ret) {
  419. netdev_err(ndev, "devm_request_irq failed\n");
  420. goto init_fail;
  421. }
  422. ndev->netdev_ops = &moxart_netdev_ops;
  423. netif_napi_add(ndev, &priv->napi, moxart_rx_poll, RX_DESC_NUM);
  424. ndev->priv_flags |= IFF_UNICAST_FLT;
  425. ndev->irq = irq;
  426. SET_NETDEV_DEV(ndev, &pdev->dev);
  427. ret = register_netdev(ndev);
  428. if (ret) {
  429. free_netdev(ndev);
  430. goto init_fail;
  431. }
  432. netdev_dbg(ndev, "%s: IRQ=%d address=%pM\n",
  433. __func__, ndev->irq, ndev->dev_addr);
  434. return 0;
  435. init_fail:
  436. netdev_err(ndev, "init failed\n");
  437. moxart_mac_free_memory(ndev);
  438. irq_map_fail:
  439. free_netdev(ndev);
  440. return ret;
  441. }
  442. static int moxart_remove(struct platform_device *pdev)
  443. {
  444. struct net_device *ndev = platform_get_drvdata(pdev);
  445. unregister_netdev(ndev);
  446. free_irq(ndev->irq, ndev);
  447. moxart_mac_free_memory(ndev);
  448. free_netdev(ndev);
  449. return 0;
  450. }
  451. static const struct of_device_id moxart_mac_match[] = {
  452. { .compatible = "moxa,moxart-mac" },
  453. { }
  454. };
  455. MODULE_DEVICE_TABLE(of, moxart_mac_match);
  456. static struct platform_driver moxart_mac_driver = {
  457. .probe = moxart_mac_probe,
  458. .remove = moxart_remove,
  459. .driver = {
  460. .name = "moxart-ethernet",
  461. .of_match_table = moxart_mac_match,
  462. },
  463. };
  464. module_platform_driver(moxart_mac_driver);
  465. MODULE_DESCRIPTION("MOXART RTL8201CP Ethernet driver");
  466. MODULE_LICENSE("GPL v2");
  467. MODULE_AUTHOR("Jonas Jensen <jonas.jensen@gmail.com>");