4 * driver for the GE IP-OCTAL boards
5 * Copyright (c) 2009 Nicolas Serafini, EIC2 SA
6 * Copyright (c) 2010,2011 Samuel Iglesias Gonsalvez <siglesia@cern.ch>, CERN
7 * Copyright (c) 2012 Samuel Iglesias Gonsalvez <siglesias@igalia.com>, Igalia
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the Free
11 * Software Foundation; version 2 of the License.
14 #include <linux/device.h>
15 #include <linux/module.h>
16 #include <linux/interrupt.h>
17 #include <linux/sched.h>
18 #include <linux/tty.h>
19 #include <linux/serial.h>
20 #include <linux/tty_flip.h>
21 #include <linux/slab.h>
22 #include <linux/atomic.h>
28 #define IP_OCTAL_ID_SPACE_VECTOR 0x41
29 #define IP_OCTAL_NB_BLOCKS 4
31 static const struct tty_operations ipoctal_fops;
33 struct ipoctal_channel {
34 struct ipoctal_stats stats;
35 unsigned int nb_bytes;
36 unsigned int count_wr;
37 wait_queue_head_t queue;
39 unsigned int pointer_read;
40 unsigned int pointer_write;
42 struct tty_port tty_port;
43 union scc2698_channel __iomem *regs;
44 union scc2698_block __iomem *block_regs;
45 unsigned int board_id;
46 unsigned char *board_write;
52 struct list_head list;
53 struct ipack_device *dev;
54 unsigned int board_id;
55 struct ipoctal_channel channel[NR_CHANNELS];
57 struct tty_driver *tty_drv;
60 /* Linked list to save the registered devices */
61 static LIST_HEAD(ipoctal_list);
63 static struct ipoctal *ipoctal_find_board(struct tty_struct *tty)
67 list_for_each_entry(p, &ipoctal_list, list) {
68 if (tty->driver->major == p->tty_drv->major)
75 static int ipoctal_port_activate(struct tty_port *port, struct tty_struct *tty)
77 struct ipoctal *ipoctal;
78 struct ipoctal_channel *channel;
80 ipoctal = ipoctal_find_board(tty);
82 if (ipoctal == NULL) {
83 dev_err(tty->dev, "Device not found. Major %d\n",
87 channel = &ipoctal->channel[tty->index];
89 iowrite8(CR_ENABLE_RX, &channel->regs->w.cr);
93 static int ipoctal_open(struct tty_struct *tty, struct file *file)
96 struct ipoctal *ipoctal;
97 struct ipoctal_channel *channel;
99 ipoctal = ipoctal_find_board(tty);
101 if (ipoctal == NULL) {
102 dev_err(tty->dev, "Device not found. Major %d\n",
106 channel = &ipoctal->channel[tty->index];
108 if (atomic_read(&channel->open))
111 tty->driver_data = channel;
113 res = tty_port_open(&channel->tty_port, tty, file);
117 atomic_inc(&channel->open);
121 static void ipoctal_reset_stats(struct ipoctal_stats *stats)
125 stats->rcv_break = 0;
126 stats->framing_err = 0;
127 stats->overrun_err = 0;
128 stats->parity_err = 0;
131 static void ipoctal_free_channel(struct ipoctal_channel *channel)
133 ipoctal_reset_stats(&channel->stats);
134 channel->pointer_read = 0;
135 channel->pointer_write = 0;
136 channel->nb_bytes = 0;
139 static void ipoctal_close(struct tty_struct *tty, struct file *filp)
141 struct ipoctal_channel *channel = tty->driver_data;
143 tty_port_close(&channel->tty_port, tty, filp);
145 if (atomic_dec_and_test(&channel->open))
146 ipoctal_free_channel(channel);
149 static int ipoctal_get_icount(struct tty_struct *tty,
150 struct serial_icounter_struct *icount)
152 struct ipoctal_channel *channel = tty->driver_data;
158 icount->rx = channel->stats.rx;
159 icount->tx = channel->stats.tx;
160 icount->frame = channel->stats.framing_err;
161 icount->parity = channel->stats.parity_err;
162 icount->brk = channel->stats.rcv_break;
166 static void ipoctal_irq_rx(struct ipoctal_channel *channel,
167 struct tty_struct *tty, u8 sr)
169 unsigned char value = ioread8(&channel->regs->r.rhr);
170 unsigned char flag = TTY_NORMAL;
172 /* Error: count statistics */
174 iowrite8(CR_CMD_RESET_ERR_STATUS, &channel->regs->w.cr);
176 if (sr & SR_OVERRUN_ERROR) {
177 channel->stats.overrun_err++;
178 /* Overrun doesn't affect the current character*/
179 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
181 if (sr & SR_PARITY_ERROR) {
182 channel->stats.parity_err++;
185 if (sr & SR_FRAMING_ERROR) {
186 channel->stats.framing_err++;
189 if (sr & SR_RECEIVED_BREAK) {
190 channel->stats.rcv_break++;
195 tty_insert_flip_char(tty, value, flag);
198 static void ipoctal_irq_tx(struct ipoctal_channel *channel)
201 unsigned int *pointer_write = &channel->pointer_write;
203 if (channel->nb_bytes <= 0) {
204 channel->nb_bytes = 0;
208 value = channel->tty_port.xmit_buf[*pointer_write];
209 iowrite8(value, &channel->regs->w.thr);
213 *pointer_write = *pointer_write % PAGE_SIZE;
216 if ((channel->nb_bytes == 0) &&
217 (waitqueue_active(&channel->queue))) {
219 if (channel->board_id != IPACK1_DEVICE_ID_SBS_OCTAL_485) {
220 *channel->board_write = 1;
221 wake_up_interruptible(&channel->queue);
226 static void ipoctal_irq_channel(struct ipoctal_channel *channel)
229 struct tty_struct *tty;
231 /* If there is no client, skip the check */
232 if (!atomic_read(&channel->open))
235 tty = tty_port_tty_get(&channel->tty_port);
238 /* The HW is organized in pair of channels. See which register we need
240 isr = ioread8(&channel->block_regs->r.isr);
241 sr = ioread8(&channel->regs->r.sr);
243 /* In case of RS-485, change from TX to RX when finishing TX.
245 if ((channel->board_id == IPACK1_DEVICE_ID_SBS_OCTAL_485) &&
246 (sr & SR_TX_EMPTY) && (channel->nb_bytes == 0)) {
247 iowrite8(CR_DISABLE_TX, &channel->regs->w.cr);
248 iowrite8(CR_CMD_NEGATE_RTSN, &channel->regs->w.cr);
249 iowrite8(CR_ENABLE_RX, &channel->regs->w.cr);
250 *channel->board_write = 1;
251 wake_up_interruptible(&channel->queue);
255 if ((isr & channel->isr_rx_rdy_mask) && (sr & SR_RX_READY))
256 ipoctal_irq_rx(channel, tty, sr);
258 /* TX of each character */
259 if ((isr & channel->isr_tx_rdy_mask) && (sr & SR_TX_READY))
260 ipoctal_irq_tx(channel);
262 tty_flip_buffer_push(tty);
266 static int ipoctal_irq_handler(void *arg)
269 struct ipoctal *ipoctal = (struct ipoctal *) arg;
271 /* Check all channels */
272 for (i = 0; i < NR_CHANNELS; i++)
273 ipoctal_irq_channel(&ipoctal->channel[i]);
278 static int ipoctal_check_model(struct ipack_device *dev, unsigned char *id)
280 unsigned char manufacturerID;
281 unsigned char board_id;
284 manufacturerID = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MANUFACTURER_ID);
285 if (manufacturerID != IPACK1_VENDOR_ID_SBS)
288 board_id = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MODEL);
290 case IPACK1_DEVICE_ID_SBS_OCTAL_232:
291 case IPACK1_DEVICE_ID_SBS_OCTAL_422:
292 case IPACK1_DEVICE_ID_SBS_OCTAL_485:
302 static const struct tty_port_operations ipoctal_tty_port_ops = {
304 .activate = ipoctal_port_activate,
307 static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
308 unsigned int slot, unsigned int vector)
312 struct tty_driver *tty;
314 unsigned char board_id;
315 struct ipoctal_channel *channel;
316 union scc2698_channel __iomem *chan_regs;
317 union scc2698_block __iomem *block_regs;
319 res = ipoctal->dev->bus->ops->map_space(ipoctal->dev, 0,
322 dev_err(&ipoctal->dev->dev,
323 "Unable to map slot [%d:%d] ID space!\n",
328 res = ipoctal_check_model(ipoctal->dev, &board_id);
330 ipoctal->dev->bus->ops->unmap_space(ipoctal->dev,
332 goto out_unregister_id_space;
334 ipoctal->board_id = board_id;
336 res = ipoctal->dev->bus->ops->map_space(ipoctal->dev, 0,
339 dev_err(&ipoctal->dev->dev,
340 "Unable to map slot [%d:%d] IO space!\n",
342 goto out_unregister_id_space;
345 res = ipoctal->dev->bus->ops->map_space(ipoctal->dev,
346 0x8000, IPACK_MEM_SPACE);
348 dev_err(&ipoctal->dev->dev,
349 "Unable to map slot [%d:%d] MEM space!\n",
351 goto out_unregister_io_space;
354 /* Save the virtual address to access the registers easily */
356 (union scc2698_channel __iomem *) ipoctal->dev->io_space.address;
358 (union scc2698_block __iomem *) ipoctal->dev->io_space.address;
360 /* Disable RX and TX before touching anything */
361 for (i = 0; i < NR_CHANNELS ; i++) {
362 struct ipoctal_channel *channel = &ipoctal->channel[i];
363 channel->regs = chan_regs + i;
364 channel->block_regs = block_regs + (i >> 1);
365 channel->board_write = &ipoctal->write;
366 channel->board_id = ipoctal->board_id;
368 channel->isr_tx_rdy_mask = ISR_TxRDY_B;
369 channel->isr_rx_rdy_mask = ISR_RxRDY_FFULL_B;
371 channel->isr_tx_rdy_mask = ISR_TxRDY_A;
372 channel->isr_rx_rdy_mask = ISR_RxRDY_FFULL_A;
375 iowrite8(CR_DISABLE_RX | CR_DISABLE_TX, &channel->regs->w.cr);
376 iowrite8(CR_CMD_RESET_RX, &channel->regs->w.cr);
377 iowrite8(CR_CMD_RESET_TX, &channel->regs->w.cr);
378 iowrite8(MR1_CHRL_8_BITS | MR1_ERROR_CHAR | MR1_RxINT_RxRDY,
379 &channel->regs->w.mr); /* mr1 */
380 iowrite8(0, &channel->regs->w.mr); /* mr2 */
381 iowrite8(TX_CLK_9600 | RX_CLK_9600, &channel->regs->w.csr);
384 for (i = 0; i < IP_OCTAL_NB_BLOCKS; i++) {
385 iowrite8(ACR_BRG_SET2, &block_regs[i].w.acr);
386 iowrite8(OPCR_MPP_OUTPUT | OPCR_MPOa_RTSN | OPCR_MPOb_RTSN,
387 &block_regs[i].w.opcr);
388 iowrite8(IMR_TxRDY_A | IMR_RxRDY_FFULL_A | IMR_DELTA_BREAK_A |
389 IMR_TxRDY_B | IMR_RxRDY_FFULL_B | IMR_DELTA_BREAK_B,
390 &block_regs[i].w.imr);
394 * IP-OCTAL has different addresses to copy its IRQ vector.
395 * Depending of the carrier these addresses are accesible or not.
396 * More info in the datasheet.
398 ipoctal->dev->bus->ops->request_irq(ipoctal->dev, vector,
399 ipoctal_irq_handler, ipoctal);
400 iowrite8(vector, ipoctal->dev->mem_space.address + 1);
402 /* Register the TTY device */
404 /* Each IP-OCTAL channel is a TTY port */
405 tty = alloc_tty_driver(NR_CHANNELS);
409 goto out_unregister_slot_unmap;
412 /* Fill struct tty_driver with ipoctal data */
413 tty->owner = THIS_MODULE;
414 tty->driver_name = "ipoctal";
415 sprintf(name, "ipoctal.%d.%d.", bus_nr, slot);
419 tty->minor_start = 0;
420 tty->type = TTY_DRIVER_TYPE_SERIAL;
421 tty->subtype = SERIAL_TYPE_NORMAL;
422 tty->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
423 tty->init_termios = tty_std_termios;
424 tty->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
425 tty->init_termios.c_ispeed = 9600;
426 tty->init_termios.c_ospeed = 9600;
428 tty_set_operations(tty, &ipoctal_fops);
429 res = tty_register_driver(tty);
431 dev_err(&ipoctal->dev->dev, "Can't register tty driver.\n");
433 goto out_unregister_slot_unmap;
436 /* Save struct tty_driver for use it when uninstalling the device */
437 ipoctal->tty_drv = tty;
439 for (i = 0; i < NR_CHANNELS; i++) {
440 channel = &ipoctal->channel[i];
441 tty_port_init(&channel->tty_port);
442 tty_port_alloc_xmit_buf(&channel->tty_port);
443 channel->tty_port.ops = &ipoctal_tty_port_ops;
445 ipoctal_reset_stats(&channel->stats);
446 channel->nb_bytes = 0;
447 init_waitqueue_head(&channel->queue);
449 spin_lock_init(&channel->lock);
450 channel->pointer_read = 0;
451 channel->pointer_write = 0;
452 channel->nb_bytes = 0;
453 tty_register_device(tty, i, NULL);
456 * Enable again the RX. TX will be enabled when
457 * there is something to send
459 iowrite8(CR_ENABLE_RX, &channel->regs->w.cr);
464 out_unregister_slot_unmap:
465 ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_ID_SPACE);
466 out_unregister_io_space:
467 ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_IO_SPACE);
468 out_unregister_id_space:
469 ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_MEM_SPACE);
473 static inline int ipoctal_copy_write_buffer(struct ipoctal_channel *channel,
474 const unsigned char *buf,
479 unsigned int *pointer_read = &channel->pointer_read;
481 /* Copy the bytes from the user buffer to the internal one */
482 for (i = 0; i < count; i++) {
483 if (i <= (PAGE_SIZE - channel->nb_bytes)) {
484 spin_lock_irqsave(&channel->lock, flags);
485 channel->tty_port.xmit_buf[*pointer_read] = buf[i];
486 *pointer_read = (*pointer_read + 1) % PAGE_SIZE;
488 spin_unlock_irqrestore(&channel->lock, flags);
496 static int ipoctal_write(struct ipoctal_channel *channel,
497 const unsigned char *buf, int count)
499 channel->nb_bytes = 0;
500 channel->count_wr = 0;
502 ipoctal_copy_write_buffer(channel, buf, count);
504 /* As the IP-OCTAL 485 only supports half duplex, do it manually */
505 if (channel->board_id == IPACK1_DEVICE_ID_SBS_OCTAL_485) {
506 iowrite8(CR_DISABLE_RX, &channel->regs->w.cr);
507 iowrite8(CR_CMD_ASSERT_RTSN, &channel->regs->w.cr);
511 * Send a packet and then disable TX to avoid failure after several send
514 iowrite8(CR_ENABLE_TX, &channel->regs->w.cr);
515 wait_event_interruptible(channel->queue, *channel->board_write);
516 iowrite8(CR_DISABLE_TX, &channel->regs->w.cr);
518 *channel->board_write = 0;
519 return channel->count_wr;
522 static int ipoctal_write_tty(struct tty_struct *tty,
523 const unsigned char *buf, int count)
525 struct ipoctal_channel *channel = tty->driver_data;
527 return ipoctal_write(channel, buf, count);
530 static int ipoctal_write_room(struct tty_struct *tty)
532 struct ipoctal_channel *channel = tty->driver_data;
534 return PAGE_SIZE - channel->nb_bytes;
537 static int ipoctal_chars_in_buffer(struct tty_struct *tty)
539 struct ipoctal_channel *channel = tty->driver_data;
541 return channel->nb_bytes;
544 static void ipoctal_set_termios(struct tty_struct *tty,
545 struct ktermios *old_termios)
548 unsigned char mr1 = 0;
549 unsigned char mr2 = 0;
550 unsigned char csr = 0;
551 struct ipoctal_channel *channel = tty->driver_data;
554 cflag = tty->termios->c_cflag;
556 /* Disable and reset everything before change the setup */
557 iowrite8(CR_DISABLE_RX | CR_DISABLE_TX, &channel->regs->w.cr);
558 iowrite8(CR_CMD_RESET_RX, &channel->regs->w.cr);
559 iowrite8(CR_CMD_RESET_TX, &channel->regs->w.cr);
560 iowrite8(CR_CMD_RESET_ERR_STATUS, &channel->regs->w.cr);
561 iowrite8(CR_CMD_RESET_MR, &channel->regs->w.cr);
563 /* Set Bits per chars */
564 switch (cflag & CSIZE) {
566 mr1 |= MR1_CHRL_6_BITS;
569 mr1 |= MR1_CHRL_7_BITS;
573 mr1 |= MR1_CHRL_8_BITS;
574 /* By default, select CS8 */
575 tty->termios->c_cflag = (cflag & ~CSIZE) | CS8;
582 mr1 |= MR1_PARITY_ON | MR1_PARITY_ODD;
584 mr1 |= MR1_PARITY_ON | MR1_PARITY_EVEN;
586 mr1 |= MR1_PARITY_OFF;
588 /* Mark or space parity is not supported */
589 tty->termios->c_cflag &= ~CMSPAR;
593 mr2 |= MR2_STOP_BITS_LENGTH_2;
595 mr2 |= MR2_STOP_BITS_LENGTH_1;
597 /* Set the flow control */
598 switch (channel->board_id) {
599 case IPACK1_DEVICE_ID_SBS_OCTAL_232:
600 if (cflag & CRTSCTS) {
601 mr1 |= MR1_RxRTS_CONTROL_ON;
602 mr2 |= MR2_TxRTS_CONTROL_OFF | MR2_CTS_ENABLE_TX_ON;
604 mr1 |= MR1_RxRTS_CONTROL_OFF;
605 mr2 |= MR2_TxRTS_CONTROL_OFF | MR2_CTS_ENABLE_TX_OFF;
608 case IPACK1_DEVICE_ID_SBS_OCTAL_422:
609 mr1 |= MR1_RxRTS_CONTROL_OFF;
610 mr2 |= MR2_TxRTS_CONTROL_OFF | MR2_CTS_ENABLE_TX_OFF;
612 case IPACK1_DEVICE_ID_SBS_OCTAL_485:
613 mr1 |= MR1_RxRTS_CONTROL_OFF;
614 mr2 |= MR2_TxRTS_CONTROL_ON | MR2_CTS_ENABLE_TX_OFF;
621 baud = tty_get_baud_rate(tty);
622 tty_termios_encode_baud_rate(tty->termios, baud, baud);
625 switch (tty->termios->c_ospeed) {
627 csr |= TX_CLK_75 | RX_CLK_75;
630 csr |= TX_CLK_110 | RX_CLK_110;
633 csr |= TX_CLK_150 | RX_CLK_150;
636 csr |= TX_CLK_300 | RX_CLK_300;
639 csr |= TX_CLK_600 | RX_CLK_600;
642 csr |= TX_CLK_1200 | RX_CLK_1200;
645 csr |= TX_CLK_1800 | RX_CLK_1800;
648 csr |= TX_CLK_2000 | RX_CLK_2000;
651 csr |= TX_CLK_2400 | RX_CLK_2400;
654 csr |= TX_CLK_4800 | RX_CLK_4800;
657 csr |= TX_CLK_9600 | RX_CLK_9600;
660 csr |= TX_CLK_19200 | RX_CLK_19200;
664 csr |= TX_CLK_38400 | RX_CLK_38400;
665 /* In case of default, we establish 38400 bps */
666 tty_termios_encode_baud_rate(tty->termios, 38400, 38400);
670 mr1 |= MR1_ERROR_CHAR;
671 mr1 |= MR1_RxINT_RxRDY;
673 /* Write the control registers */
674 iowrite8(mr1, &channel->regs->w.mr);
675 iowrite8(mr2, &channel->regs->w.mr);
676 iowrite8(csr, &channel->regs->w.csr);
678 /* Enable again the RX */
679 iowrite8(CR_ENABLE_RX, &channel->regs->w.cr);
682 static void ipoctal_hangup(struct tty_struct *tty)
685 struct ipoctal_channel *channel = tty->driver_data;
690 spin_lock_irqsave(&channel->lock, flags);
691 channel->nb_bytes = 0;
692 channel->pointer_read = 0;
693 channel->pointer_write = 0;
694 spin_unlock_irqrestore(&channel->lock, flags);
696 tty_port_hangup(&channel->tty_port);
698 iowrite8(CR_DISABLE_RX | CR_DISABLE_TX, &channel->regs->w.cr);
699 iowrite8(CR_CMD_RESET_RX, &channel->regs->w.cr);
700 iowrite8(CR_CMD_RESET_TX, &channel->regs->w.cr);
701 iowrite8(CR_CMD_RESET_ERR_STATUS, &channel->regs->w.cr);
702 iowrite8(CR_CMD_RESET_MR, &channel->regs->w.cr);
704 clear_bit(ASYNCB_INITIALIZED, &channel->tty_port.flags);
705 wake_up_interruptible(&channel->tty_port.open_wait);
708 static const struct tty_operations ipoctal_fops = {
710 .open = ipoctal_open,
711 .close = ipoctal_close,
712 .write = ipoctal_write_tty,
713 .set_termios = ipoctal_set_termios,
714 .write_room = ipoctal_write_room,
715 .chars_in_buffer = ipoctal_chars_in_buffer,
716 .get_icount = ipoctal_get_icount,
717 .hangup = ipoctal_hangup,
720 static int ipoctal_probe(struct ipack_device *dev)
723 struct ipoctal *ipoctal;
725 ipoctal = kzalloc(sizeof(struct ipoctal), GFP_KERNEL);
730 res = ipoctal_inst_slot(ipoctal, dev->bus_nr, dev->slot, dev->irq);
734 list_add_tail(&ipoctal->list, &ipoctal_list);
742 static void __ipoctal_remove(struct ipoctal *ipoctal)
746 ipoctal->dev->bus->ops->free_irq(ipoctal->dev);
748 for (i = 0; i < NR_CHANNELS; i++) {
749 struct ipoctal_channel *channel = &ipoctal->channel[i];
750 tty_unregister_device(ipoctal->tty_drv, i);
751 tty_port_free_xmit_buf(&channel->tty_port);
754 tty_unregister_driver(ipoctal->tty_drv);
755 put_tty_driver(ipoctal->tty_drv);
756 list_del(&ipoctal->list);
760 static void ipoctal_remove(struct ipack_device *device)
762 struct ipoctal *ipoctal, *next;
764 list_for_each_entry_safe(ipoctal, next, &ipoctal_list, list) {
765 if (ipoctal->dev == device)
766 __ipoctal_remove(ipoctal);
770 static DEFINE_IPACK_DEVICE_TABLE(ipoctal_ids) = {
771 { IPACK_DEVICE(IPACK_ID_VERSION_1, IPACK1_VENDOR_ID_SBS,
772 IPACK1_DEVICE_ID_SBS_OCTAL_232) },
773 { IPACK_DEVICE(IPACK_ID_VERSION_1, IPACK1_VENDOR_ID_SBS,
774 IPACK1_DEVICE_ID_SBS_OCTAL_422) },
775 { IPACK_DEVICE(IPACK_ID_VERSION_1, IPACK1_VENDOR_ID_SBS,
776 IPACK1_DEVICE_ID_SBS_OCTAL_485) },
780 MODULE_DEVICE_TABLE(ipack, ipoctal_ids);
782 static const struct ipack_driver_ops ipoctal_drv_ops = {
783 .probe = ipoctal_probe,
784 .remove = ipoctal_remove,
787 static struct ipack_driver driver = {
788 .ops = &ipoctal_drv_ops,
789 .id_table = ipoctal_ids,
792 static int __init ipoctal_init(void)
794 return ipack_driver_register(&driver, THIS_MODULE, KBUILD_MODNAME);
797 static void __exit ipoctal_exit(void)
799 ipack_driver_unregister(&driver);
802 MODULE_DESCRIPTION("IP-Octal 232, 422 and 485 device driver");
803 MODULE_LICENSE("GPL");
805 module_init(ipoctal_init);
806 module_exit(ipoctal_exit);