ec_bhf.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. /*
  2. * drivers/net/ethernet/ec_bhf.c
  3. *
  4. * Copyright (C) 2014 Darek Marcinkiewicz <reksio@newterm.pl>
  5. *
  6. * This software is licensed under the terms of the GNU General Public
  7. * License version 2, as published by the Free Software Foundation, and
  8. * may be copied, distributed, and modified under those terms.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. */
  16. /* This is a driver for EtherCAT master module present on CCAT FPGA.
  17. * Those can be found on Bechhoff CX50xx industrial PCs.
  18. */
  19. #include <linux/kernel.h>
  20. #include <linux/module.h>
  21. #include <linux/moduleparam.h>
  22. #include <linux/pci.h>
  23. #include <linux/init.h>
  24. #include <linux/netdevice.h>
  25. #include <linux/etherdevice.h>
  26. #include <linux/ip.h>
  27. #include <linux/skbuff.h>
  28. #include <linux/hrtimer.h>
  29. #include <linux/interrupt.h>
  30. #include <linux/stat.h>
  31. #define TIMER_INTERVAL_NSEC 20000
  32. #define INFO_BLOCK_SIZE 0x10
  33. #define INFO_BLOCK_TYPE 0x0
  34. #define INFO_BLOCK_REV 0x2
  35. #define INFO_BLOCK_BLK_CNT 0x4
  36. #define INFO_BLOCK_TX_CHAN 0x4
  37. #define INFO_BLOCK_RX_CHAN 0x5
  38. #define INFO_BLOCK_OFFSET 0x8
  39. #define EC_MII_OFFSET 0x4
  40. #define EC_FIFO_OFFSET 0x8
  41. #define EC_MAC_OFFSET 0xc
  42. #define MAC_FRAME_ERR_CNT 0x0
  43. #define MAC_RX_ERR_CNT 0x1
  44. #define MAC_CRC_ERR_CNT 0x2
  45. #define MAC_LNK_LST_ERR_CNT 0x3
  46. #define MAC_TX_FRAME_CNT 0x10
  47. #define MAC_RX_FRAME_CNT 0x14
  48. #define MAC_TX_FIFO_LVL 0x20
  49. #define MAC_DROPPED_FRMS 0x28
  50. #define MAC_CONNECTED_CCAT_FLAG 0x78
  51. #define MII_MAC_ADDR 0x8
  52. #define MII_MAC_FILT_FLAG 0xe
  53. #define MII_LINK_STATUS 0xf
  54. #define FIFO_TX_REG 0x0
  55. #define FIFO_TX_RESET 0x8
  56. #define FIFO_RX_REG 0x10
  57. #define FIFO_RX_ADDR_VALID (1u << 31)
  58. #define FIFO_RX_RESET 0x18
  59. #define DMA_CHAN_OFFSET 0x1000
  60. #define DMA_CHAN_SIZE 0x8
  61. #define DMA_WINDOW_SIZE_MASK 0xfffffffc
  62. #define ETHERCAT_MASTER_ID 0x14
  63. static struct pci_device_id ids[] = {
  64. { PCI_DEVICE(0x15ec, 0x5000), },
  65. { 0, }
  66. };
  67. MODULE_DEVICE_TABLE(pci, ids);
  68. struct rx_header {
  69. #define RXHDR_NEXT_ADDR_MASK 0xffffffu
  70. #define RXHDR_NEXT_VALID (1u << 31)
  71. __le32 next;
  72. #define RXHDR_NEXT_RECV_FLAG 0x1
  73. __le32 recv;
  74. #define RXHDR_LEN_MASK 0xfffu
  75. __le16 len;
  76. __le16 port;
  77. __le32 reserved;
  78. u8 timestamp[8];
  79. } __packed;
  80. #define PKT_PAYLOAD_SIZE 0x7e8
  81. struct rx_desc {
  82. struct rx_header header;
  83. u8 data[PKT_PAYLOAD_SIZE];
  84. } __packed;
  85. struct tx_header {
  86. __le16 len;
  87. #define TX_HDR_PORT_0 0x1
  88. #define TX_HDR_PORT_1 0x2
  89. u8 port;
  90. u8 ts_enable;
  91. #define TX_HDR_SENT 0x1
  92. __le32 sent;
  93. u8 timestamp[8];
  94. } __packed;
  95. struct tx_desc {
  96. struct tx_header header;
  97. u8 data[PKT_PAYLOAD_SIZE];
  98. } __packed;
  99. #define FIFO_SIZE 64
  100. static long polling_frequency = TIMER_INTERVAL_NSEC;
  101. struct bhf_dma {
  102. u8 *buf;
  103. size_t len;
  104. dma_addr_t buf_phys;
  105. u8 *alloc;
  106. size_t alloc_len;
  107. dma_addr_t alloc_phys;
  108. };
  109. struct ec_bhf_priv {
  110. struct net_device *net_dev;
  111. struct pci_dev *dev;
  112. void __iomem *io;
  113. void __iomem *dma_io;
  114. struct hrtimer hrtimer;
  115. int tx_dma_chan;
  116. int rx_dma_chan;
  117. void __iomem *ec_io;
  118. void __iomem *fifo_io;
  119. void __iomem *mii_io;
  120. void __iomem *mac_io;
  121. struct bhf_dma rx_buf;
  122. struct rx_desc *rx_descs;
  123. int rx_dnext;
  124. int rx_dcount;
  125. struct bhf_dma tx_buf;
  126. struct tx_desc *tx_descs;
  127. int tx_dcount;
  128. int tx_dnext;
  129. u64 stat_rx_bytes;
  130. u64 stat_tx_bytes;
  131. };
  132. #define PRIV_TO_DEV(priv) (&(priv)->dev->dev)
  133. static void ec_bhf_reset(struct ec_bhf_priv *priv)
  134. {
  135. iowrite8(0, priv->mac_io + MAC_FRAME_ERR_CNT);
  136. iowrite8(0, priv->mac_io + MAC_RX_ERR_CNT);
  137. iowrite8(0, priv->mac_io + MAC_CRC_ERR_CNT);
  138. iowrite8(0, priv->mac_io + MAC_LNK_LST_ERR_CNT);
  139. iowrite32(0, priv->mac_io + MAC_TX_FRAME_CNT);
  140. iowrite32(0, priv->mac_io + MAC_RX_FRAME_CNT);
  141. iowrite8(0, priv->mac_io + MAC_DROPPED_FRMS);
  142. iowrite8(0, priv->fifo_io + FIFO_TX_RESET);
  143. iowrite8(0, priv->fifo_io + FIFO_RX_RESET);
  144. iowrite8(0, priv->mac_io + MAC_TX_FIFO_LVL);
  145. }
  146. static void ec_bhf_send_packet(struct ec_bhf_priv *priv, struct tx_desc *desc)
  147. {
  148. u32 len = le16_to_cpu(desc->header.len) + sizeof(desc->header);
  149. u32 addr = (u8 *)desc - priv->tx_buf.buf;
  150. iowrite32((ALIGN(len, 8) << 24) | addr, priv->fifo_io + FIFO_TX_REG);
  151. }
  152. static int ec_bhf_desc_sent(struct tx_desc *desc)
  153. {
  154. return le32_to_cpu(desc->header.sent) & TX_HDR_SENT;
  155. }
  156. static void ec_bhf_process_tx(struct ec_bhf_priv *priv)
  157. {
  158. if (unlikely(netif_queue_stopped(priv->net_dev))) {
  159. /* Make sure that we perceive changes to tx_dnext. */
  160. smp_rmb();
  161. if (ec_bhf_desc_sent(&priv->tx_descs[priv->tx_dnext]))
  162. netif_wake_queue(priv->net_dev);
  163. }
  164. }
  165. static int ec_bhf_pkt_received(struct rx_desc *desc)
  166. {
  167. return le32_to_cpu(desc->header.recv) & RXHDR_NEXT_RECV_FLAG;
  168. }
  169. static void ec_bhf_add_rx_desc(struct ec_bhf_priv *priv, struct rx_desc *desc)
  170. {
  171. iowrite32(FIFO_RX_ADDR_VALID | ((u8 *)(desc) - priv->rx_buf.buf),
  172. priv->fifo_io + FIFO_RX_REG);
  173. }
  174. static void ec_bhf_process_rx(struct ec_bhf_priv *priv)
  175. {
  176. struct rx_desc *desc = &priv->rx_descs[priv->rx_dnext];
  177. while (ec_bhf_pkt_received(desc)) {
  178. int pkt_size = (le16_to_cpu(desc->header.len) &
  179. RXHDR_LEN_MASK) - sizeof(struct rx_header) - 4;
  180. u8 *data = desc->data;
  181. struct sk_buff *skb;
  182. skb = netdev_alloc_skb_ip_align(priv->net_dev, pkt_size);
  183. if (skb) {
  184. memcpy(skb_put(skb, pkt_size), data, pkt_size);
  185. skb->protocol = eth_type_trans(skb, priv->net_dev);
  186. priv->stat_rx_bytes += pkt_size;
  187. netif_rx(skb);
  188. } else {
  189. dev_err_ratelimited(PRIV_TO_DEV(priv),
  190. "Couldn't allocate a skb_buff for a packet of size %u\n",
  191. pkt_size);
  192. }
  193. desc->header.recv = 0;
  194. ec_bhf_add_rx_desc(priv, desc);
  195. priv->rx_dnext = (priv->rx_dnext + 1) % priv->rx_dcount;
  196. desc = &priv->rx_descs[priv->rx_dnext];
  197. }
  198. }
  199. static enum hrtimer_restart ec_bhf_timer_fun(struct hrtimer *timer)
  200. {
  201. struct ec_bhf_priv *priv = container_of(timer, struct ec_bhf_priv,
  202. hrtimer);
  203. ec_bhf_process_rx(priv);
  204. ec_bhf_process_tx(priv);
  205. if (!netif_running(priv->net_dev))
  206. return HRTIMER_NORESTART;
  207. hrtimer_forward_now(timer, ktime_set(0, polling_frequency));
  208. return HRTIMER_RESTART;
  209. }
  210. static int ec_bhf_setup_offsets(struct ec_bhf_priv *priv)
  211. {
  212. struct device *dev = PRIV_TO_DEV(priv);
  213. unsigned block_count, i;
  214. void __iomem *ec_info;
  215. block_count = ioread8(priv->io + INFO_BLOCK_BLK_CNT);
  216. for (i = 0; i < block_count; i++) {
  217. u16 type = ioread16(priv->io + i * INFO_BLOCK_SIZE +
  218. INFO_BLOCK_TYPE);
  219. if (type == ETHERCAT_MASTER_ID)
  220. break;
  221. }
  222. if (i == block_count) {
  223. dev_err(dev, "EtherCAT master with DMA block not found\n");
  224. return -ENODEV;
  225. }
  226. ec_info = priv->io + i * INFO_BLOCK_SIZE;
  227. priv->tx_dma_chan = ioread8(ec_info + INFO_BLOCK_TX_CHAN);
  228. priv->rx_dma_chan = ioread8(ec_info + INFO_BLOCK_RX_CHAN);
  229. priv->ec_io = priv->io + ioread32(ec_info + INFO_BLOCK_OFFSET);
  230. priv->mii_io = priv->ec_io + ioread32(priv->ec_io + EC_MII_OFFSET);
  231. priv->fifo_io = priv->ec_io + ioread32(priv->ec_io + EC_FIFO_OFFSET);
  232. priv->mac_io = priv->ec_io + ioread32(priv->ec_io + EC_MAC_OFFSET);
  233. return 0;
  234. }
  235. static netdev_tx_t ec_bhf_start_xmit(struct sk_buff *skb,
  236. struct net_device *net_dev)
  237. {
  238. struct ec_bhf_priv *priv = netdev_priv(net_dev);
  239. struct tx_desc *desc;
  240. unsigned len;
  241. desc = &priv->tx_descs[priv->tx_dnext];
  242. skb_copy_and_csum_dev(skb, desc->data);
  243. len = skb->len;
  244. memset(&desc->header, 0, sizeof(desc->header));
  245. desc->header.len = cpu_to_le16(len);
  246. desc->header.port = TX_HDR_PORT_0;
  247. ec_bhf_send_packet(priv, desc);
  248. priv->tx_dnext = (priv->tx_dnext + 1) % priv->tx_dcount;
  249. if (!ec_bhf_desc_sent(&priv->tx_descs[priv->tx_dnext])) {
  250. /* Make sure that updates to tx_dnext are perceived
  251. * by timer routine.
  252. */
  253. smp_wmb();
  254. netif_stop_queue(net_dev);
  255. }
  256. priv->stat_tx_bytes += len;
  257. dev_kfree_skb(skb);
  258. return NETDEV_TX_OK;
  259. }
  260. static int ec_bhf_alloc_dma_mem(struct ec_bhf_priv *priv,
  261. struct bhf_dma *buf,
  262. int channel,
  263. int size)
  264. {
  265. int offset = channel * DMA_CHAN_SIZE + DMA_CHAN_OFFSET;
  266. struct device *dev = PRIV_TO_DEV(priv);
  267. u32 mask;
  268. iowrite32(0xffffffff, priv->dma_io + offset);
  269. mask = ioread32(priv->dma_io + offset);
  270. mask &= DMA_WINDOW_SIZE_MASK;
  271. /* We want to allocate a chunk of memory that is:
  272. * - aligned to the mask we just read
  273. * - is of size 2^mask bytes (at most)
  274. * In order to ensure that we will allocate buffer of
  275. * 2 * 2^mask bytes.
  276. */
  277. buf->len = min_t(int, ~mask + 1, size);
  278. buf->alloc_len = 2 * buf->len;
  279. buf->alloc = dma_alloc_coherent(dev, buf->alloc_len, &buf->alloc_phys,
  280. GFP_KERNEL);
  281. if (buf->alloc == NULL) {
  282. dev_err(dev, "Failed to allocate buffer\n");
  283. return -ENOMEM;
  284. }
  285. buf->buf_phys = (buf->alloc_phys + buf->len) & mask;
  286. buf->buf = buf->alloc + (buf->buf_phys - buf->alloc_phys);
  287. iowrite32(0, priv->dma_io + offset + 4);
  288. iowrite32(buf->buf_phys, priv->dma_io + offset);
  289. return 0;
  290. }
  291. static void ec_bhf_setup_tx_descs(struct ec_bhf_priv *priv)
  292. {
  293. int i = 0;
  294. priv->tx_dcount = priv->tx_buf.len / sizeof(struct tx_desc);
  295. priv->tx_descs = (struct tx_desc *)priv->tx_buf.buf;
  296. priv->tx_dnext = 0;
  297. for (i = 0; i < priv->tx_dcount; i++)
  298. priv->tx_descs[i].header.sent = cpu_to_le32(TX_HDR_SENT);
  299. }
  300. static void ec_bhf_setup_rx_descs(struct ec_bhf_priv *priv)
  301. {
  302. int i;
  303. priv->rx_dcount = priv->rx_buf.len / sizeof(struct rx_desc);
  304. priv->rx_descs = (struct rx_desc *)priv->rx_buf.buf;
  305. priv->rx_dnext = 0;
  306. for (i = 0; i < priv->rx_dcount; i++) {
  307. struct rx_desc *desc = &priv->rx_descs[i];
  308. u32 next;
  309. if (i != priv->rx_dcount - 1)
  310. next = (u8 *)(desc + 1) - priv->rx_buf.buf;
  311. else
  312. next = 0;
  313. next |= RXHDR_NEXT_VALID;
  314. desc->header.next = cpu_to_le32(next);
  315. desc->header.recv = 0;
  316. ec_bhf_add_rx_desc(priv, desc);
  317. }
  318. }
  319. static int ec_bhf_open(struct net_device *net_dev)
  320. {
  321. struct ec_bhf_priv *priv = netdev_priv(net_dev);
  322. struct device *dev = PRIV_TO_DEV(priv);
  323. int err = 0;
  324. ec_bhf_reset(priv);
  325. err = ec_bhf_alloc_dma_mem(priv, &priv->rx_buf, priv->rx_dma_chan,
  326. FIFO_SIZE * sizeof(struct rx_desc));
  327. if (err) {
  328. dev_err(dev, "Failed to allocate rx buffer\n");
  329. goto out;
  330. }
  331. ec_bhf_setup_rx_descs(priv);
  332. err = ec_bhf_alloc_dma_mem(priv, &priv->tx_buf, priv->tx_dma_chan,
  333. FIFO_SIZE * sizeof(struct tx_desc));
  334. if (err) {
  335. dev_err(dev, "Failed to allocate tx buffer\n");
  336. goto error_rx_free;
  337. }
  338. iowrite8(0, priv->mii_io + MII_MAC_FILT_FLAG);
  339. ec_bhf_setup_tx_descs(priv);
  340. netif_start_queue(net_dev);
  341. hrtimer_init(&priv->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
  342. priv->hrtimer.function = ec_bhf_timer_fun;
  343. hrtimer_start(&priv->hrtimer, ktime_set(0, polling_frequency),
  344. HRTIMER_MODE_REL);
  345. return 0;
  346. error_rx_free:
  347. dma_free_coherent(dev, priv->rx_buf.alloc_len, priv->rx_buf.alloc,
  348. priv->rx_buf.alloc_len);
  349. out:
  350. return err;
  351. }
  352. static int ec_bhf_stop(struct net_device *net_dev)
  353. {
  354. struct ec_bhf_priv *priv = netdev_priv(net_dev);
  355. struct device *dev = PRIV_TO_DEV(priv);
  356. hrtimer_cancel(&priv->hrtimer);
  357. ec_bhf_reset(priv);
  358. netif_tx_disable(net_dev);
  359. dma_free_coherent(dev, priv->tx_buf.alloc_len,
  360. priv->tx_buf.alloc, priv->tx_buf.alloc_phys);
  361. dma_free_coherent(dev, priv->rx_buf.alloc_len,
  362. priv->rx_buf.alloc, priv->rx_buf.alloc_phys);
  363. return 0;
  364. }
  365. static struct rtnl_link_stats64 *
  366. ec_bhf_get_stats(struct net_device *net_dev,
  367. struct rtnl_link_stats64 *stats)
  368. {
  369. struct ec_bhf_priv *priv = netdev_priv(net_dev);
  370. stats->rx_errors = ioread8(priv->mac_io + MAC_RX_ERR_CNT) +
  371. ioread8(priv->mac_io + MAC_CRC_ERR_CNT) +
  372. ioread8(priv->mac_io + MAC_FRAME_ERR_CNT);
  373. stats->rx_packets = ioread32(priv->mac_io + MAC_RX_FRAME_CNT);
  374. stats->tx_packets = ioread32(priv->mac_io + MAC_TX_FRAME_CNT);
  375. stats->rx_dropped = ioread8(priv->mac_io + MAC_DROPPED_FRMS);
  376. stats->tx_bytes = priv->stat_tx_bytes;
  377. stats->rx_bytes = priv->stat_rx_bytes;
  378. return stats;
  379. }
  380. static const struct net_device_ops ec_bhf_netdev_ops = {
  381. .ndo_start_xmit = ec_bhf_start_xmit,
  382. .ndo_open = ec_bhf_open,
  383. .ndo_stop = ec_bhf_stop,
  384. .ndo_get_stats64 = ec_bhf_get_stats,
  385. .ndo_change_mtu = eth_change_mtu,
  386. .ndo_validate_addr = eth_validate_addr,
  387. .ndo_set_mac_address = eth_mac_addr
  388. };
  389. static int ec_bhf_probe(struct pci_dev *dev, const struct pci_device_id *id)
  390. {
  391. struct net_device *net_dev;
  392. struct ec_bhf_priv *priv;
  393. void __iomem *dma_io;
  394. void __iomem *io;
  395. int err = 0;
  396. err = pci_enable_device(dev);
  397. if (err)
  398. return err;
  399. pci_set_master(dev);
  400. err = pci_set_dma_mask(dev, DMA_BIT_MASK(32));
  401. if (err) {
  402. dev_err(&dev->dev,
  403. "Required dma mask not supported, failed to initialize device\n");
  404. err = -EIO;
  405. goto err_disable_dev;
  406. }
  407. err = pci_set_consistent_dma_mask(dev, DMA_BIT_MASK(32));
  408. if (err) {
  409. dev_err(&dev->dev,
  410. "Required dma mask not supported, failed to initialize device\n");
  411. goto err_disable_dev;
  412. }
  413. err = pci_request_regions(dev, "ec_bhf");
  414. if (err) {
  415. dev_err(&dev->dev, "Failed to request pci memory regions\n");
  416. goto err_disable_dev;
  417. }
  418. io = pci_iomap(dev, 0, 0);
  419. if (!io) {
  420. dev_err(&dev->dev, "Failed to map pci card memory bar 0");
  421. err = -EIO;
  422. goto err_release_regions;
  423. }
  424. dma_io = pci_iomap(dev, 2, 0);
  425. if (!dma_io) {
  426. dev_err(&dev->dev, "Failed to map pci card memory bar 2");
  427. err = -EIO;
  428. goto err_unmap;
  429. }
  430. net_dev = alloc_etherdev(sizeof(struct ec_bhf_priv));
  431. if (net_dev == NULL) {
  432. err = -ENOMEM;
  433. goto err_unmap_dma_io;
  434. }
  435. pci_set_drvdata(dev, net_dev);
  436. SET_NETDEV_DEV(net_dev, &dev->dev);
  437. net_dev->features = 0;
  438. net_dev->flags |= IFF_NOARP;
  439. net_dev->netdev_ops = &ec_bhf_netdev_ops;
  440. priv = netdev_priv(net_dev);
  441. priv->net_dev = net_dev;
  442. priv->io = io;
  443. priv->dma_io = dma_io;
  444. priv->dev = dev;
  445. err = ec_bhf_setup_offsets(priv);
  446. if (err < 0)
  447. goto err_free_net_dev;
  448. memcpy_fromio(net_dev->dev_addr, priv->mii_io + MII_MAC_ADDR, 6);
  449. err = register_netdev(net_dev);
  450. if (err < 0)
  451. goto err_free_net_dev;
  452. return 0;
  453. err_free_net_dev:
  454. free_netdev(net_dev);
  455. err_unmap_dma_io:
  456. pci_iounmap(dev, dma_io);
  457. err_unmap:
  458. pci_iounmap(dev, io);
  459. err_release_regions:
  460. pci_release_regions(dev);
  461. err_disable_dev:
  462. pci_clear_master(dev);
  463. pci_disable_device(dev);
  464. return err;
  465. }
  466. static void ec_bhf_remove(struct pci_dev *dev)
  467. {
  468. struct net_device *net_dev = pci_get_drvdata(dev);
  469. struct ec_bhf_priv *priv = netdev_priv(net_dev);
  470. unregister_netdev(net_dev);
  471. free_netdev(net_dev);
  472. pci_iounmap(dev, priv->dma_io);
  473. pci_iounmap(dev, priv->io);
  474. pci_release_regions(dev);
  475. pci_clear_master(dev);
  476. pci_disable_device(dev);
  477. }
  478. static struct pci_driver pci_driver = {
  479. .name = "ec_bhf",
  480. .id_table = ids,
  481. .probe = ec_bhf_probe,
  482. .remove = ec_bhf_remove,
  483. };
  484. module_pci_driver(pci_driver);
  485. module_param(polling_frequency, long, S_IRUGO);
  486. MODULE_PARM_DESC(polling_frequency, "Polling timer frequency in ns");
  487. MODULE_LICENSE("GPL");
  488. MODULE_AUTHOR("Dariusz Marcinkiewicz <reksio@newterm.pl>");