^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /* hplance.c : the Linux/hp300/lance ethernet driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (C) 05/1998 Peter Maydell <pmaydell@chiark.greenend.org.uk>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Based on the Sun Lance driver and the NetBSD HP Lance driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Uses the generic 7990.c LANCE code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/ioport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/string.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/delay.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/errno.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <linux/pgtable.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) /* Used for the temporal inet entries and routing */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #include <linux/socket.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <linux/route.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #include <linux/dio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include <linux/netdevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #include <linux/etherdevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #include <linux/skbuff.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #include <asm/io.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #include "hplance.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) /* We have 16392 bytes of RAM for the init block and buffers. This places
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) * an upper limit on the number of buffers we can use. NetBSD uses 8 Rx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * buffers and 2 Tx buffers, it takes (8 + 2) * 1544 bytes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #define LANCE_LOG_TX_BUFFERS 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #define LANCE_LOG_RX_BUFFERS 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #include "7990.h" /* use generic LANCE code */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) /* Our private data structure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) struct hplance_private {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) struct lance_private lance;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) /* function prototypes... This is easy because all the grot is in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) * generic LANCE support. All we have to support is probing for boards,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) * plus board-specific init, open and close actions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) * Oh, and we need to tell the generic code how to read and write LANCE registers...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) static int hplance_init_one(struct dio_dev *d, const struct dio_device_id *ent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) static void hplance_init(struct net_device *dev, struct dio_dev *d);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) static void hplance_remove_one(struct dio_dev *d);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) static void hplance_writerap(void *priv, unsigned short value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) static void hplance_writerdp(void *priv, unsigned short value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) static unsigned short hplance_readrdp(void *priv);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) static int hplance_open(struct net_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) static int hplance_close(struct net_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) static struct dio_device_id hplance_dio_tbl[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) { DIO_ID_LAN },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) { 0 }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) static struct dio_driver hplance_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) .name = "hplance",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) .id_table = hplance_dio_tbl,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) .probe = hplance_init_one,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) .remove = hplance_remove_one,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) static const struct net_device_ops hplance_netdev_ops = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) .ndo_open = hplance_open,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) .ndo_stop = hplance_close,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) .ndo_start_xmit = lance_start_xmit,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) .ndo_set_rx_mode = lance_set_multicast,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) .ndo_validate_addr = eth_validate_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) .ndo_set_mac_address = eth_mac_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) #ifdef CONFIG_NET_POLL_CONTROLLER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) .ndo_poll_controller = lance_poll,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) /* Find all the HP Lance boards and initialise them... */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) static int hplance_init_one(struct dio_dev *d, const struct dio_device_id *ent)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) struct net_device *dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) int err = -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) dev = alloc_etherdev(sizeof(struct hplance_private));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) if (!dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) err = -EBUSY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) if (!request_mem_region(dio_resource_start(d),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) dio_resource_len(d), d->name))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) goto out_free_netdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) hplance_init(dev, d);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) err = register_netdev(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) goto out_release_mem_region;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) dio_set_drvdata(d, dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) printk(KERN_INFO "%s: %s; select code %d, addr %pM, irq %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) dev->name, d->name, d->scode, dev->dev_addr, d->ipl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) out_release_mem_region:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) release_mem_region(dio_resource_start(d), dio_resource_len(d));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) out_free_netdev:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) free_netdev(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) static void hplance_remove_one(struct dio_dev *d)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) struct net_device *dev = dio_get_drvdata(d);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) unregister_netdev(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) release_mem_region(dio_resource_start(d), dio_resource_len(d));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) free_netdev(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) /* Initialise a single lance board at the given DIO device */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) static void hplance_init(struct net_device *dev, struct dio_dev *d)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) unsigned long va = (d->resource.start + DIO_VIRADDRBASE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) struct hplance_private *lp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) /* reset the board */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) out_8(va + DIO_IDOFF, 0xff);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) udelay(100); /* ariba! ariba! udelay! udelay! */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) /* Fill the dev fields */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) dev->base_addr = va;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) dev->netdev_ops = &hplance_netdev_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) dev->dma = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) for (i = 0; i < 6; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) /* The NVRAM holds our ethernet address, one nibble per byte,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) * at bytes NVRAMOFF+1,3,5,7,9...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) dev->dev_addr[i] = ((in_8(va + HPLANCE_NVRAMOFF + i*4 + 1) & 0xF) << 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) | (in_8(va + HPLANCE_NVRAMOFF + i*4 + 3) & 0xF);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) lp = netdev_priv(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) lp->lance.name = d->name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) lp->lance.base = va;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) lp->lance.init_block = (struct lance_init_block *)(va + HPLANCE_MEMOFF); /* CPU addr */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) lp->lance.lance_init_block = NULL; /* LANCE addr of same RAM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) lp->lance.busmaster_regval = LE_C3_BSWP; /* we're bigendian */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) lp->lance.irq = d->ipl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) lp->lance.writerap = hplance_writerap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) lp->lance.writerdp = hplance_writerdp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) lp->lance.readrdp = hplance_readrdp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) lp->lance.lance_log_rx_bufs = LANCE_LOG_RX_BUFFERS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) lp->lance.lance_log_tx_bufs = LANCE_LOG_TX_BUFFERS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) lp->lance.rx_ring_mod_mask = RX_RING_MOD_MASK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) lp->lance.tx_ring_mod_mask = TX_RING_MOD_MASK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) /* This is disgusting. We have to check the DIO status register for ack every
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) * time we read or write the LANCE registers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) static void hplance_writerap(void *priv, unsigned short value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) struct lance_private *lp = (struct lance_private *)priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) do {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) out_be16(lp->base + HPLANCE_REGOFF + LANCE_RAP, value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) } while ((in_8(lp->base + HPLANCE_STATUS) & LE_ACK) == 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) static void hplance_writerdp(void *priv, unsigned short value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) struct lance_private *lp = (struct lance_private *)priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) do {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) out_be16(lp->base + HPLANCE_REGOFF + LANCE_RDP, value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) } while ((in_8(lp->base + HPLANCE_STATUS) & LE_ACK) == 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) static unsigned short hplance_readrdp(void *priv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) struct lance_private *lp = (struct lance_private *)priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) __u16 value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) do {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) value = in_be16(lp->base + HPLANCE_REGOFF + LANCE_RDP);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) } while ((in_8(lp->base + HPLANCE_STATUS) & LE_ACK) == 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) return value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) static int hplance_open(struct net_device *dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) int status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) struct lance_private *lp = netdev_priv(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) status = lance_open(dev); /* call generic lance open code */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) if (status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) return status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) /* enable interrupts at board level. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) out_8(lp->base + HPLANCE_STATUS, LE_IE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) static int hplance_close(struct net_device *dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) struct lance_private *lp = netdev_priv(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) out_8(lp->base + HPLANCE_STATUS, 0); /* disable interrupts at boardlevel */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) lance_close(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) static int __init hplance_init_module(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) return dio_register_driver(&hplance_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) static void __exit hplance_cleanup_module(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) dio_unregister_driver(&hplance_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) module_init(hplance_init_module);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) module_exit(hplance_cleanup_module);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) MODULE_LICENSE("GPL");