at91_ether.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. /*
  2. * Ethernet driver for the Atmel AT91RM9200 (Thunder)
  3. *
  4. * Copyright (C) 2003 SAN People (Pty) Ltd
  5. *
  6. * Based on an earlier Atmel EMAC macrocell driver by Atmel and Lineo Inc.
  7. * Initial version by Rick Bronson 01/11/2003
  8. *
  9. * Intel LXT971A PHY support by Christopher Bahns & David Knickerbocker
  10. * (Polaroid Corporation)
  11. *
  12. * Realtek RTL8201(B)L PHY support by Roman Avramenko <roman@imsystems.ru>
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License
  16. * as published by the Free Software Foundation; either version
  17. * 2 of the License, or (at your option) any later version.
  18. */
  19. #include <linux/module.h>
  20. #include <linux/init.h>
  21. #include <linux/interrupt.h>
  22. #include <linux/netdevice.h>
  23. #include <linux/etherdevice.h>
  24. #include <linux/skbuff.h>
  25. #include <linux/dma-mapping.h>
  26. #include <linux/ethtool.h>
  27. #include <linux/platform_data/macb.h>
  28. #include <linux/platform_device.h>
  29. #include <linux/clk.h>
  30. #include <linux/gfp.h>
  31. #include <linux/phy.h>
  32. #include <asm/io.h>
  33. #include <asm/uaccess.h>
  34. #include <asm/mach-types.h>
  35. #include "macb.h"
  36. #define DRV_NAME "at91_ether"
  37. #define DRV_VERSION "1.0"
  38. /* ......................... ADDRESS MANAGEMENT ........................ */
  39. /*
  40. * NOTE: Your bootloader must always set the MAC address correctly before
  41. * booting into Linux.
  42. *
  43. * - It must always set the MAC address after reset, even if it doesn't
  44. * happen to access the Ethernet while it's booting. Some versions of
  45. * U-Boot on the AT91RM9200-DK do not do this.
  46. *
  47. * - Likewise it must store the addresses in the correct byte order.
  48. * MicroMonitor (uMon) on the CSB337 does this incorrectly (and
  49. * continues to do so, for bug-compatibility).
  50. */
  51. static short __init unpack_mac_address(struct net_device *dev, unsigned int hi, unsigned int lo)
  52. {
  53. char addr[6];
  54. if (machine_is_csb337()) {
  55. addr[5] = (lo & 0xff); /* The CSB337 bootloader stores the MAC the wrong-way around */
  56. addr[4] = (lo & 0xff00) >> 8;
  57. addr[3] = (lo & 0xff0000) >> 16;
  58. addr[2] = (lo & 0xff000000) >> 24;
  59. addr[1] = (hi & 0xff);
  60. addr[0] = (hi & 0xff00) >> 8;
  61. }
  62. else {
  63. addr[0] = (lo & 0xff);
  64. addr[1] = (lo & 0xff00) >> 8;
  65. addr[2] = (lo & 0xff0000) >> 16;
  66. addr[3] = (lo & 0xff000000) >> 24;
  67. addr[4] = (hi & 0xff);
  68. addr[5] = (hi & 0xff00) >> 8;
  69. }
  70. if (is_valid_ether_addr(addr)) {
  71. memcpy(dev->dev_addr, &addr, 6);
  72. return 1;
  73. }
  74. return 0;
  75. }
  76. /*
  77. * Set the ethernet MAC address in dev->dev_addr
  78. */
  79. static void __init get_mac_address(struct net_device *dev)
  80. {
  81. struct macb *lp = netdev_priv(dev);
  82. /* Check Specific-Address 1 */
  83. if (unpack_mac_address(dev, macb_readl(lp, SA1T), macb_readl(lp, SA1B)))
  84. return;
  85. /* Check Specific-Address 2 */
  86. if (unpack_mac_address(dev, macb_readl(lp, SA2T), macb_readl(lp, SA2B)))
  87. return;
  88. /* Check Specific-Address 3 */
  89. if (unpack_mac_address(dev, macb_readl(lp, SA3T), macb_readl(lp, SA3B)))
  90. return;
  91. /* Check Specific-Address 4 */
  92. if (unpack_mac_address(dev, macb_readl(lp, SA4T), macb_readl(lp, SA4B)))
  93. return;
  94. printk(KERN_ERR "at91_ether: Your bootloader did not configure a MAC address.\n");
  95. }
  96. /*
  97. * Program the hardware MAC address from dev->dev_addr.
  98. */
  99. static void update_mac_address(struct net_device *dev)
  100. {
  101. struct macb *lp = netdev_priv(dev);
  102. macb_writel(lp, SA1B, (dev->dev_addr[3] << 24) | (dev->dev_addr[2] << 16)
  103. | (dev->dev_addr[1] << 8) | (dev->dev_addr[0]));
  104. macb_writel(lp, SA1T, (dev->dev_addr[5] << 8) | (dev->dev_addr[4]));
  105. macb_writel(lp, SA2B, 0);
  106. macb_writel(lp, SA2T, 0);
  107. }
  108. /*
  109. * Store the new hardware address in dev->dev_addr, and update the MAC.
  110. */
  111. static int set_mac_address(struct net_device *dev, void* addr)
  112. {
  113. struct sockaddr *address = addr;
  114. if (!is_valid_ether_addr(address->sa_data))
  115. return -EADDRNOTAVAIL;
  116. memcpy(dev->dev_addr, address->sa_data, dev->addr_len);
  117. update_mac_address(dev);
  118. printk("%s: Setting MAC address to %pM\n", dev->name,
  119. dev->dev_addr);
  120. return 0;
  121. }
  122. /* ................................ MAC ................................ */
  123. /*
  124. * Initialize and start the Receiver and Transmit subsystems
  125. */
  126. static void at91ether_start(struct net_device *dev)
  127. {
  128. struct macb *lp = netdev_priv(dev);
  129. struct recv_desc_bufs *dlist, *dlist_phys;
  130. int i;
  131. unsigned long ctl;
  132. dlist = lp->dlist;
  133. dlist_phys = lp->dlist_phys;
  134. for (i = 0; i < MAX_RX_DESCR; i++) {
  135. dlist->descriptors[i].addr = (unsigned int) &dlist_phys->recv_buf[i][0];
  136. dlist->descriptors[i].size = 0;
  137. }
  138. /* Set the Wrap bit on the last descriptor */
  139. dlist->descriptors[i-1].addr |= MACB_BIT(RX_WRAP);
  140. /* Reset buffer index */
  141. lp->rxBuffIndex = 0;
  142. /* Program address of descriptor list in Rx Buffer Queue register */
  143. macb_writel(lp, RBQP, (unsigned long) dlist_phys);
  144. /* Enable Receive and Transmit */
  145. ctl = macb_readl(lp, NCR);
  146. macb_writel(lp, NCR, ctl | MACB_BIT(RE) | MACB_BIT(TE));
  147. }
  148. /*
  149. * Open the ethernet interface
  150. */
  151. static int at91ether_open(struct net_device *dev)
  152. {
  153. struct macb *lp = netdev_priv(dev);
  154. unsigned long ctl;
  155. if (!is_valid_ether_addr(dev->dev_addr))
  156. return -EADDRNOTAVAIL;
  157. /* Clear internal statistics */
  158. ctl = macb_readl(lp, NCR);
  159. macb_writel(lp, NCR, ctl | MACB_BIT(CLRSTAT));
  160. /* Update the MAC address (incase user has changed it) */
  161. update_mac_address(dev);
  162. /* Enable MAC interrupts */
  163. macb_writel(lp, IER, MACB_BIT(RCOMP) | MACB_BIT(RXUBR)
  164. | MACB_BIT(ISR_TUND) | MACB_BIT(ISR_RLE) | MACB_BIT(TCOMP)
  165. | MACB_BIT(ISR_ROVR) | MACB_BIT(HRESP));
  166. at91ether_start(dev);
  167. /* schedule a link state check */
  168. phy_start(lp->phy_dev);
  169. netif_start_queue(dev);
  170. return 0;
  171. }
  172. /*
  173. * Close the interface
  174. */
  175. static int at91ether_close(struct net_device *dev)
  176. {
  177. struct macb *lp = netdev_priv(dev);
  178. unsigned long ctl;
  179. /* Disable Receiver and Transmitter */
  180. ctl = macb_readl(lp, NCR);
  181. macb_writel(lp, NCR, ctl & ~(MACB_BIT(TE) | MACB_BIT(RE)));
  182. /* Disable MAC interrupts */
  183. macb_writel(lp, IDR, MACB_BIT(RCOMP) | MACB_BIT(RXUBR)
  184. | MACB_BIT(ISR_TUND) | MACB_BIT(ISR_RLE)
  185. | MACB_BIT(TCOMP) | MACB_BIT(ISR_ROVR)
  186. | MACB_BIT(HRESP));
  187. netif_stop_queue(dev);
  188. return 0;
  189. }
  190. /*
  191. * Transmit packet.
  192. */
  193. static int at91ether_start_xmit(struct sk_buff *skb, struct net_device *dev)
  194. {
  195. struct macb *lp = netdev_priv(dev);
  196. if (macb_readl(lp, TSR) & MACB_BIT(RM9200_BNQ)) {
  197. netif_stop_queue(dev);
  198. /* Store packet information (to free when Tx completed) */
  199. lp->skb = skb;
  200. lp->skb_length = skb->len;
  201. lp->skb_physaddr = dma_map_single(NULL, skb->data, skb->len, DMA_TO_DEVICE);
  202. dev->stats.tx_bytes += skb->len;
  203. /* Set address of the data in the Transmit Address register */
  204. macb_writel(lp, TAR, lp->skb_physaddr);
  205. /* Set length of the packet in the Transmit Control register */
  206. macb_writel(lp, TCR, skb->len);
  207. } else {
  208. printk(KERN_ERR "at91_ether.c: at91ether_start_xmit() called, but device is busy!\n");
  209. return NETDEV_TX_BUSY; /* if we return anything but zero, dev.c:1055 calls kfree_skb(skb)
  210. on this skb, he also reports -ENETDOWN and printk's, so either
  211. we free and return(0) or don't free and return 1 */
  212. }
  213. return NETDEV_TX_OK;
  214. }
  215. /*
  216. * Update the current statistics from the internal statistics registers.
  217. */
  218. static struct net_device_stats *at91ether_stats(struct net_device *dev)
  219. {
  220. struct macb *lp = netdev_priv(dev);
  221. int ale, lenerr, seqe, lcol, ecol;
  222. if (netif_running(dev)) {
  223. dev->stats.rx_packets += macb_readl(lp, FRO); /* Good frames received */
  224. ale = macb_readl(lp, ALE);
  225. dev->stats.rx_frame_errors += ale; /* Alignment errors */
  226. lenerr = macb_readl(lp, ELE) + macb_readl(lp, USF);
  227. dev->stats.rx_length_errors += lenerr; /* Excessive Length or Undersize Frame error */
  228. seqe = macb_readl(lp, FCSE);
  229. dev->stats.rx_crc_errors += seqe; /* CRC error */
  230. dev->stats.rx_fifo_errors += macb_readl(lp, RRE);/* Receive buffer not available */
  231. dev->stats.rx_errors += (ale + lenerr + seqe
  232. + macb_readl(lp, RSE) + macb_readl(lp, RJA));
  233. dev->stats.tx_packets += macb_readl(lp, FTO); /* Frames successfully transmitted */
  234. dev->stats.tx_fifo_errors += macb_readl(lp, TUND); /* Transmit FIFO underruns */
  235. dev->stats.tx_carrier_errors += macb_readl(lp, CSE); /* Carrier Sense errors */
  236. dev->stats.tx_heartbeat_errors += macb_readl(lp, STE);/* Heartbeat error */
  237. lcol = macb_readl(lp, LCOL);
  238. ecol = macb_readl(lp, EXCOL);
  239. dev->stats.tx_window_errors += lcol; /* Late collisions */
  240. dev->stats.tx_aborted_errors += ecol; /* 16 collisions */
  241. dev->stats.collisions += (macb_readl(lp, SCF) + macb_readl(lp, MCF) + lcol + ecol);
  242. }
  243. return &dev->stats;
  244. }
  245. /*
  246. * Extract received frame from buffer descriptors and sent to upper layers.
  247. * (Called from interrupt context)
  248. */
  249. static void at91ether_rx(struct net_device *dev)
  250. {
  251. struct macb *lp = netdev_priv(dev);
  252. struct recv_desc_bufs *dlist;
  253. unsigned char *p_recv;
  254. struct sk_buff *skb;
  255. unsigned int pktlen;
  256. dlist = lp->dlist;
  257. while (dlist->descriptors[lp->rxBuffIndex].addr & MACB_BIT(RX_USED)) {
  258. p_recv = dlist->recv_buf[lp->rxBuffIndex];
  259. pktlen = dlist->descriptors[lp->rxBuffIndex].size & 0x7ff; /* Length of frame including FCS */
  260. skb = netdev_alloc_skb(dev, pktlen + 2);
  261. if (skb != NULL) {
  262. skb_reserve(skb, 2);
  263. memcpy(skb_put(skb, pktlen), p_recv, pktlen);
  264. skb->protocol = eth_type_trans(skb, dev);
  265. dev->stats.rx_bytes += pktlen;
  266. netif_rx(skb);
  267. }
  268. else {
  269. dev->stats.rx_dropped += 1;
  270. printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name);
  271. }
  272. if (dlist->descriptors[lp->rxBuffIndex].size & MACB_BIT(RX_MHASH_MATCH))
  273. dev->stats.multicast++;
  274. dlist->descriptors[lp->rxBuffIndex].addr &= ~MACB_BIT(RX_USED); /* reset ownership bit */
  275. if (lp->rxBuffIndex == MAX_RX_DESCR-1) /* wrap after last buffer */
  276. lp->rxBuffIndex = 0;
  277. else
  278. lp->rxBuffIndex++;
  279. }
  280. }
  281. /*
  282. * MAC interrupt handler
  283. */
  284. static irqreturn_t at91ether_interrupt(int irq, void *dev_id)
  285. {
  286. struct net_device *dev = (struct net_device *) dev_id;
  287. struct macb *lp = netdev_priv(dev);
  288. unsigned long intstatus, ctl;
  289. /* MAC Interrupt Status register indicates what interrupts are pending.
  290. It is automatically cleared once read. */
  291. intstatus = macb_readl(lp, ISR);
  292. if (intstatus & MACB_BIT(RCOMP)) /* Receive complete */
  293. at91ether_rx(dev);
  294. if (intstatus & MACB_BIT(TCOMP)) { /* Transmit complete */
  295. /* The TCOM bit is set even if the transmission failed. */
  296. if (intstatus & (MACB_BIT(ISR_TUND) | MACB_BIT(ISR_RLE)))
  297. dev->stats.tx_errors += 1;
  298. if (lp->skb) {
  299. dev_kfree_skb_irq(lp->skb);
  300. lp->skb = NULL;
  301. dma_unmap_single(NULL, lp->skb_physaddr, lp->skb_length, DMA_TO_DEVICE);
  302. }
  303. netif_wake_queue(dev);
  304. }
  305. /* Work-around for Errata #11 */
  306. if (intstatus & MACB_BIT(RXUBR)) {
  307. ctl = macb_readl(lp, NCR);
  308. macb_writel(lp, NCR, ctl & ~MACB_BIT(RE));
  309. macb_writel(lp, NCR, ctl | MACB_BIT(RE));
  310. }
  311. if (intstatus & MACB_BIT(ISR_ROVR))
  312. printk("%s: ROVR error\n", dev->name);
  313. return IRQ_HANDLED;
  314. }
  315. #ifdef CONFIG_NET_POLL_CONTROLLER
  316. static void at91ether_poll_controller(struct net_device *dev)
  317. {
  318. unsigned long flags;
  319. local_irq_save(flags);
  320. at91ether_interrupt(dev->irq, dev);
  321. local_irq_restore(flags);
  322. }
  323. #endif
  324. static const struct net_device_ops at91ether_netdev_ops = {
  325. .ndo_open = at91ether_open,
  326. .ndo_stop = at91ether_close,
  327. .ndo_start_xmit = at91ether_start_xmit,
  328. .ndo_get_stats = at91ether_stats,
  329. .ndo_set_rx_mode = macb_set_rx_mode,
  330. .ndo_set_mac_address = set_mac_address,
  331. .ndo_do_ioctl = macb_ioctl,
  332. .ndo_validate_addr = eth_validate_addr,
  333. .ndo_change_mtu = eth_change_mtu,
  334. #ifdef CONFIG_NET_POLL_CONTROLLER
  335. .ndo_poll_controller = at91ether_poll_controller,
  336. #endif
  337. };
  338. /*
  339. * Detect MAC & PHY and perform ethernet interface initialization
  340. */
  341. static int __init at91ether_probe(struct platform_device *pdev)
  342. {
  343. struct macb_platform_data *board_data = pdev->dev.platform_data;
  344. struct resource *regs;
  345. struct net_device *dev;
  346. struct phy_device *phydev;
  347. struct macb *lp;
  348. int res;
  349. regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  350. if (!regs)
  351. return -ENOENT;
  352. dev = alloc_etherdev(sizeof(struct macb));
  353. if (!dev)
  354. return -ENOMEM;
  355. lp = netdev_priv(dev);
  356. lp->pdev = pdev;
  357. lp->dev = dev;
  358. lp->board_data = *board_data;
  359. spin_lock_init(&lp->lock);
  360. dev->base_addr = regs->start; /* physical base address */
  361. lp->regs = ioremap(regs->start, regs->end - regs->start + 1);
  362. if (!lp->regs) {
  363. res = -ENOMEM;
  364. goto err_free_dev;
  365. }
  366. /* Clock */
  367. lp->pclk = clk_get(&pdev->dev, "ether_clk");
  368. if (IS_ERR(lp->pclk)) {
  369. res = PTR_ERR(lp->pclk);
  370. goto err_ioumap;
  371. }
  372. clk_enable(lp->pclk);
  373. /* Install the interrupt handler */
  374. dev->irq = platform_get_irq(pdev, 0);
  375. if (request_irq(dev->irq, at91ether_interrupt, 0, dev->name, dev)) {
  376. res = -EBUSY;
  377. goto err_disable_clock;
  378. }
  379. /* Allocate memory for DMA Receive descriptors */
  380. lp->dlist = (struct recv_desc_bufs *) dma_alloc_coherent(NULL, sizeof(struct recv_desc_bufs), (dma_addr_t *) &lp->dlist_phys, GFP_KERNEL);
  381. if (lp->dlist == NULL) {
  382. res = -ENOMEM;
  383. goto err_free_irq;
  384. }
  385. ether_setup(dev);
  386. dev->netdev_ops = &at91ether_netdev_ops;
  387. dev->ethtool_ops = &macb_ethtool_ops;
  388. platform_set_drvdata(pdev, dev);
  389. SET_NETDEV_DEV(dev, &pdev->dev);
  390. get_mac_address(dev); /* Get ethernet address and store it in dev->dev_addr */
  391. update_mac_address(dev); /* Program ethernet address into MAC */
  392. macb_writel(lp, NCR, 0);
  393. if (board_data->is_rmii) {
  394. macb_writel(lp, NCFGR, MACB_BF(CLK, MACB_CLK_DIV32) | MACB_BIT(BIG) | MACB_BIT(RM9200_RMII));
  395. lp->phy_interface = PHY_INTERFACE_MODE_RMII;
  396. } else {
  397. macb_writel(lp, NCFGR, MACB_BF(CLK, MACB_CLK_DIV32) | MACB_BIT(BIG));
  398. lp->phy_interface = PHY_INTERFACE_MODE_MII;
  399. }
  400. /* Register the network interface */
  401. res = register_netdev(dev);
  402. if (res)
  403. goto err_free_dmamem;
  404. if (macb_mii_init(lp) != 0)
  405. goto err_out_unregister_netdev;
  406. netif_carrier_off(dev); /* will be enabled in open() */
  407. phydev = lp->phy_dev;
  408. netdev_info(dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
  409. phydev->drv->name, dev_name(&phydev->dev), phydev->irq);
  410. /* Display ethernet banner */
  411. printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%pM)\n",
  412. dev->name, (uint) dev->base_addr, dev->irq,
  413. macb_readl(lp, NCFGR) & MACB_BIT(SPD) ? "100-" : "10-",
  414. macb_readl(lp, NCFGR) & MACB_BIT(FD) ? "FullDuplex" : "HalfDuplex",
  415. dev->dev_addr);
  416. return 0;
  417. err_out_unregister_netdev:
  418. unregister_netdev(dev);
  419. err_free_dmamem:
  420. platform_set_drvdata(pdev, NULL);
  421. dma_free_coherent(NULL, sizeof(struct recv_desc_bufs), lp->dlist, (dma_addr_t)lp->dlist_phys);
  422. err_free_irq:
  423. free_irq(dev->irq, dev);
  424. err_disable_clock:
  425. clk_disable(lp->pclk);
  426. clk_put(lp->pclk);
  427. err_ioumap:
  428. iounmap(lp->regs);
  429. err_free_dev:
  430. free_netdev(dev);
  431. return res;
  432. }
  433. static int __devexit at91ether_remove(struct platform_device *pdev)
  434. {
  435. struct net_device *dev = platform_get_drvdata(pdev);
  436. struct macb *lp = netdev_priv(dev);
  437. if (lp->phy_dev)
  438. phy_disconnect(lp->phy_dev);
  439. mdiobus_unregister(lp->mii_bus);
  440. kfree(lp->mii_bus->irq);
  441. mdiobus_free(lp->mii_bus);
  442. unregister_netdev(dev);
  443. free_irq(dev->irq, dev);
  444. dma_free_coherent(NULL, sizeof(struct recv_desc_bufs), lp->dlist, (dma_addr_t)lp->dlist_phys);
  445. iounmap(lp->regs);
  446. clk_disable(lp->pclk);
  447. clk_put(lp->pclk);
  448. free_netdev(dev);
  449. platform_set_drvdata(pdev, NULL);
  450. return 0;
  451. }
  452. #ifdef CONFIG_PM
  453. static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg)
  454. {
  455. struct net_device *net_dev = platform_get_drvdata(pdev);
  456. struct macb *lp = netdev_priv(net_dev);
  457. if (netif_running(net_dev)) {
  458. netif_stop_queue(net_dev);
  459. netif_device_detach(net_dev);
  460. clk_disable(lp->pclk);
  461. }
  462. return 0;
  463. }
  464. static int at91ether_resume(struct platform_device *pdev)
  465. {
  466. struct net_device *net_dev = platform_get_drvdata(pdev);
  467. struct macb *lp = netdev_priv(net_dev);
  468. if (netif_running(net_dev)) {
  469. clk_enable(lp->pclk);
  470. netif_device_attach(net_dev);
  471. netif_start_queue(net_dev);
  472. }
  473. return 0;
  474. }
  475. #else
  476. #define at91ether_suspend NULL
  477. #define at91ether_resume NULL
  478. #endif
  479. static struct platform_driver at91ether_driver = {
  480. .remove = __devexit_p(at91ether_remove),
  481. .suspend = at91ether_suspend,
  482. .resume = at91ether_resume,
  483. .driver = {
  484. .name = DRV_NAME,
  485. .owner = THIS_MODULE,
  486. },
  487. };
  488. static int __init at91ether_init(void)
  489. {
  490. return platform_driver_probe(&at91ether_driver, at91ether_probe);
  491. }
  492. static void __exit at91ether_exit(void)
  493. {
  494. platform_driver_unregister(&at91ether_driver);
  495. }
  496. module_init(at91ether_init)
  497. module_exit(at91ether_exit)
  498. MODULE_LICENSE("GPL");
  499. MODULE_DESCRIPTION("AT91RM9200 EMAC Ethernet driver");
  500. MODULE_AUTHOR("Andrew Victor");
  501. MODULE_ALIAS("platform:" DRV_NAME);