Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003   USB Driver layer for GSM modems
0004 
0005   Copyright (C) 2005  Matthias Urlichs <smurf@smurf.noris.de>
0006 
0007   Portions copied from the Keyspan driver by Hugh Blemings <hugh@blemings.org>
0008 
0009   History: see the git log.
0010 
0011   Work sponsored by: Sigos GmbH, Germany <info@sigos.de>
0012 
0013   This driver exists because the "normal" serial driver doesn't work too well
0014   with GSM modems. Issues:
0015   - data loss -- one single Receive URB is not nearly enough
0016   - controlling the baud rate doesn't make sense
0017 */
0018 
0019 #define DRIVER_AUTHOR "Matthias Urlichs <smurf@smurf.noris.de>"
0020 #define DRIVER_DESC "USB Driver for GSM modems"
0021 
0022 #include <linux/kernel.h>
0023 #include <linux/jiffies.h>
0024 #include <linux/errno.h>
0025 #include <linux/slab.h>
0026 #include <linux/tty.h>
0027 #include <linux/tty_flip.h>
0028 #include <linux/module.h>
0029 #include <linux/bitops.h>
0030 #include <linux/uaccess.h>
0031 #include <linux/usb.h>
0032 #include <linux/usb/cdc.h>
0033 #include <linux/usb/serial.h>
0034 #include <linux/serial.h>
0035 #include "usb-wwan.h"
0036 
0037 /*
0038  * Generate DTR/RTS signals on the port using the SET_CONTROL_LINE_STATE request
0039  * in CDC ACM.
0040  */
0041 static int usb_wwan_send_setup(struct usb_serial_port *port)
0042 {
0043     struct usb_serial *serial = port->serial;
0044     struct usb_wwan_port_private *portdata;
0045     int val = 0;
0046     int ifnum;
0047     int res;
0048 
0049     portdata = usb_get_serial_port_data(port);
0050 
0051     if (portdata->dtr_state)
0052         val |= USB_CDC_CTRL_DTR;
0053     if (portdata->rts_state)
0054         val |= USB_CDC_CTRL_RTS;
0055 
0056     ifnum = serial->interface->cur_altsetting->desc.bInterfaceNumber;
0057 
0058     res = usb_autopm_get_interface(serial->interface);
0059     if (res)
0060         return res;
0061 
0062     res = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
0063                 USB_CDC_REQ_SET_CONTROL_LINE_STATE,
0064                 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
0065                 val, ifnum, NULL, 0, USB_CTRL_SET_TIMEOUT);
0066 
0067     usb_autopm_put_interface(port->serial->interface);
0068 
0069     return res;
0070 }
0071 
0072 void usb_wwan_dtr_rts(struct usb_serial_port *port, int on)
0073 {
0074     struct usb_wwan_port_private *portdata;
0075     struct usb_wwan_intf_private *intfdata;
0076 
0077     intfdata = usb_get_serial_data(port->serial);
0078 
0079     if (!intfdata->use_send_setup)
0080         return;
0081 
0082     portdata = usb_get_serial_port_data(port);
0083     /* FIXME: locking */
0084     portdata->rts_state = on;
0085     portdata->dtr_state = on;
0086 
0087     usb_wwan_send_setup(port);
0088 }
0089 EXPORT_SYMBOL(usb_wwan_dtr_rts);
0090 
0091 int usb_wwan_tiocmget(struct tty_struct *tty)
0092 {
0093     struct usb_serial_port *port = tty->driver_data;
0094     unsigned int value;
0095     struct usb_wwan_port_private *portdata;
0096 
0097     portdata = usb_get_serial_port_data(port);
0098 
0099     value = ((portdata->rts_state) ? TIOCM_RTS : 0) |
0100         ((portdata->dtr_state) ? TIOCM_DTR : 0) |
0101         ((portdata->cts_state) ? TIOCM_CTS : 0) |
0102         ((portdata->dsr_state) ? TIOCM_DSR : 0) |
0103         ((portdata->dcd_state) ? TIOCM_CAR : 0) |
0104         ((portdata->ri_state) ? TIOCM_RNG : 0);
0105 
0106     return value;
0107 }
0108 EXPORT_SYMBOL(usb_wwan_tiocmget);
0109 
0110 int usb_wwan_tiocmset(struct tty_struct *tty,
0111               unsigned int set, unsigned int clear)
0112 {
0113     struct usb_serial_port *port = tty->driver_data;
0114     struct usb_wwan_port_private *portdata;
0115     struct usb_wwan_intf_private *intfdata;
0116 
0117     portdata = usb_get_serial_port_data(port);
0118     intfdata = usb_get_serial_data(port->serial);
0119 
0120     if (!intfdata->use_send_setup)
0121         return -EINVAL;
0122 
0123     /* FIXME: what locks portdata fields ? */
0124     if (set & TIOCM_RTS)
0125         portdata->rts_state = 1;
0126     if (set & TIOCM_DTR)
0127         portdata->dtr_state = 1;
0128 
0129     if (clear & TIOCM_RTS)
0130         portdata->rts_state = 0;
0131     if (clear & TIOCM_DTR)
0132         portdata->dtr_state = 0;
0133     return usb_wwan_send_setup(port);
0134 }
0135 EXPORT_SYMBOL(usb_wwan_tiocmset);
0136 
0137 int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
0138            const unsigned char *buf, int count)
0139 {
0140     struct usb_wwan_port_private *portdata;
0141     struct usb_wwan_intf_private *intfdata;
0142     int i;
0143     int left, todo;
0144     struct urb *this_urb = NULL;    /* spurious */
0145     int err;
0146     unsigned long flags;
0147 
0148     portdata = usb_get_serial_port_data(port);
0149     intfdata = usb_get_serial_data(port->serial);
0150 
0151     dev_dbg(&port->dev, "%s: write (%d chars)\n", __func__, count);
0152 
0153     left = count;
0154     for (i = 0; left > 0 && i < N_OUT_URB; i++) {
0155         todo = left;
0156         if (todo > OUT_BUFLEN)
0157             todo = OUT_BUFLEN;
0158 
0159         this_urb = portdata->out_urbs[i];
0160         if (test_and_set_bit(i, &portdata->out_busy)) {
0161             if (time_before(jiffies,
0162                     portdata->tx_start_time[i] + 10 * HZ))
0163                 continue;
0164             usb_unlink_urb(this_urb);
0165             continue;
0166         }
0167         dev_dbg(&port->dev, "%s: endpoint %d buf %d\n", __func__,
0168             usb_pipeendpoint(this_urb->pipe), i);
0169 
0170         err = usb_autopm_get_interface_async(port->serial->interface);
0171         if (err < 0) {
0172             clear_bit(i, &portdata->out_busy);
0173             break;
0174         }
0175 
0176         /* send the data */
0177         memcpy(this_urb->transfer_buffer, buf, todo);
0178         this_urb->transfer_buffer_length = todo;
0179 
0180         spin_lock_irqsave(&intfdata->susp_lock, flags);
0181         if (intfdata->suspended) {
0182             usb_anchor_urb(this_urb, &portdata->delayed);
0183             spin_unlock_irqrestore(&intfdata->susp_lock, flags);
0184         } else {
0185             intfdata->in_flight++;
0186             spin_unlock_irqrestore(&intfdata->susp_lock, flags);
0187             err = usb_submit_urb(this_urb, GFP_ATOMIC);
0188             if (err) {
0189                 dev_err(&port->dev,
0190                     "%s: submit urb %d failed: %d\n",
0191                     __func__, i, err);
0192                 clear_bit(i, &portdata->out_busy);
0193                 spin_lock_irqsave(&intfdata->susp_lock, flags);
0194                 intfdata->in_flight--;
0195                 spin_unlock_irqrestore(&intfdata->susp_lock,
0196                                flags);
0197                 usb_autopm_put_interface_async(port->serial->interface);
0198                 break;
0199             }
0200         }
0201 
0202         portdata->tx_start_time[i] = jiffies;
0203         buf += todo;
0204         left -= todo;
0205     }
0206 
0207     count -= left;
0208     dev_dbg(&port->dev, "%s: wrote (did %d)\n", __func__, count);
0209     return count;
0210 }
0211 EXPORT_SYMBOL(usb_wwan_write);
0212 
0213 static void usb_wwan_indat_callback(struct urb *urb)
0214 {
0215     int err;
0216     int endpoint;
0217     struct usb_serial_port *port;
0218     struct device *dev;
0219     unsigned char *data = urb->transfer_buffer;
0220     int status = urb->status;
0221 
0222     endpoint = usb_pipeendpoint(urb->pipe);
0223     port = urb->context;
0224     dev = &port->dev;
0225 
0226     if (status) {
0227         dev_dbg(dev, "%s: nonzero status: %d on endpoint %02x.\n",
0228             __func__, status, endpoint);
0229 
0230         /* don't resubmit on fatal errors */
0231         if (status == -ESHUTDOWN || status == -ENOENT)
0232             return;
0233     } else {
0234         if (urb->actual_length) {
0235             tty_insert_flip_string(&port->port, data,
0236                     urb->actual_length);
0237             tty_flip_buffer_push(&port->port);
0238         } else
0239             dev_dbg(dev, "%s: empty read urb received\n", __func__);
0240     }
0241     /* Resubmit urb so we continue receiving */
0242     err = usb_submit_urb(urb, GFP_ATOMIC);
0243     if (err) {
0244         if (err != -EPERM && err != -ENODEV) {
0245             dev_err(dev, "%s: resubmit read urb failed. (%d)\n",
0246                 __func__, err);
0247             /* busy also in error unless we are killed */
0248             usb_mark_last_busy(port->serial->dev);
0249         }
0250     } else {
0251         usb_mark_last_busy(port->serial->dev);
0252     }
0253 }
0254 
0255 static void usb_wwan_outdat_callback(struct urb *urb)
0256 {
0257     struct usb_serial_port *port;
0258     struct usb_wwan_port_private *portdata;
0259     struct usb_wwan_intf_private *intfdata;
0260     unsigned long flags;
0261     int i;
0262 
0263     port = urb->context;
0264     intfdata = usb_get_serial_data(port->serial);
0265 
0266     usb_serial_port_softint(port);
0267     usb_autopm_put_interface_async(port->serial->interface);
0268     portdata = usb_get_serial_port_data(port);
0269     spin_lock_irqsave(&intfdata->susp_lock, flags);
0270     intfdata->in_flight--;
0271     spin_unlock_irqrestore(&intfdata->susp_lock, flags);
0272 
0273     for (i = 0; i < N_OUT_URB; ++i) {
0274         if (portdata->out_urbs[i] == urb) {
0275             smp_mb__before_atomic();
0276             clear_bit(i, &portdata->out_busy);
0277             break;
0278         }
0279     }
0280 }
0281 
0282 unsigned int usb_wwan_write_room(struct tty_struct *tty)
0283 {
0284     struct usb_serial_port *port = tty->driver_data;
0285     struct usb_wwan_port_private *portdata;
0286     int i;
0287     unsigned int data_len = 0;
0288     struct urb *this_urb;
0289 
0290     portdata = usb_get_serial_port_data(port);
0291 
0292     for (i = 0; i < N_OUT_URB; i++) {
0293         this_urb = portdata->out_urbs[i];
0294         if (this_urb && !test_bit(i, &portdata->out_busy))
0295             data_len += OUT_BUFLEN;
0296     }
0297 
0298     dev_dbg(&port->dev, "%s: %u\n", __func__, data_len);
0299     return data_len;
0300 }
0301 EXPORT_SYMBOL(usb_wwan_write_room);
0302 
0303 unsigned int usb_wwan_chars_in_buffer(struct tty_struct *tty)
0304 {
0305     struct usb_serial_port *port = tty->driver_data;
0306     struct usb_wwan_port_private *portdata;
0307     int i;
0308     unsigned int data_len = 0;
0309     struct urb *this_urb;
0310 
0311     portdata = usb_get_serial_port_data(port);
0312 
0313     for (i = 0; i < N_OUT_URB; i++) {
0314         this_urb = portdata->out_urbs[i];
0315         /* FIXME: This locking is insufficient as this_urb may
0316            go unused during the test */
0317         if (this_urb && test_bit(i, &portdata->out_busy))
0318             data_len += this_urb->transfer_buffer_length;
0319     }
0320     dev_dbg(&port->dev, "%s: %u\n", __func__, data_len);
0321     return data_len;
0322 }
0323 EXPORT_SYMBOL(usb_wwan_chars_in_buffer);
0324 
0325 int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port)
0326 {
0327     struct usb_wwan_port_private *portdata;
0328     struct usb_wwan_intf_private *intfdata;
0329     struct usb_serial *serial = port->serial;
0330     int i, err;
0331     struct urb *urb;
0332 
0333     portdata = usb_get_serial_port_data(port);
0334     intfdata = usb_get_serial_data(serial);
0335 
0336     if (port->interrupt_in_urb) {
0337         err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
0338         if (err) {
0339             dev_err(&port->dev, "%s: submit int urb failed: %d\n",
0340                 __func__, err);
0341         }
0342     }
0343 
0344     /* Start reading from the IN endpoint */
0345     for (i = 0; i < N_IN_URB; i++) {
0346         urb = portdata->in_urbs[i];
0347         if (!urb)
0348             continue;
0349         err = usb_submit_urb(urb, GFP_KERNEL);
0350         if (err) {
0351             dev_err(&port->dev,
0352                 "%s: submit read urb %d failed: %d\n",
0353                 __func__, i, err);
0354         }
0355     }
0356 
0357     spin_lock_irq(&intfdata->susp_lock);
0358     if (++intfdata->open_ports == 1)
0359         serial->interface->needs_remote_wakeup = 1;
0360     spin_unlock_irq(&intfdata->susp_lock);
0361     /* this balances a get in the generic USB serial code */
0362     usb_autopm_put_interface(serial->interface);
0363 
0364     return 0;
0365 }
0366 EXPORT_SYMBOL(usb_wwan_open);
0367 
0368 static void unbusy_queued_urb(struct urb *urb,
0369                     struct usb_wwan_port_private *portdata)
0370 {
0371     int i;
0372 
0373     for (i = 0; i < N_OUT_URB; i++) {
0374         if (urb == portdata->out_urbs[i]) {
0375             clear_bit(i, &portdata->out_busy);
0376             break;
0377         }
0378     }
0379 }
0380 
0381 void usb_wwan_close(struct usb_serial_port *port)
0382 {
0383     int i;
0384     struct usb_serial *serial = port->serial;
0385     struct usb_wwan_port_private *portdata;
0386     struct usb_wwan_intf_private *intfdata = usb_get_serial_data(serial);
0387     struct urb *urb;
0388 
0389     portdata = usb_get_serial_port_data(port);
0390 
0391     /*
0392      * Need to take susp_lock to make sure port is not already being
0393      * resumed, but no need to hold it due to the tty-port initialized
0394      * flag.
0395      */
0396     spin_lock_irq(&intfdata->susp_lock);
0397     if (--intfdata->open_ports == 0)
0398         serial->interface->needs_remote_wakeup = 0;
0399     spin_unlock_irq(&intfdata->susp_lock);
0400 
0401     for (;;) {
0402         urb = usb_get_from_anchor(&portdata->delayed);
0403         if (!urb)
0404             break;
0405         unbusy_queued_urb(urb, portdata);
0406         usb_autopm_put_interface_async(serial->interface);
0407     }
0408 
0409     for (i = 0; i < N_IN_URB; i++)
0410         usb_kill_urb(portdata->in_urbs[i]);
0411     for (i = 0; i < N_OUT_URB; i++)
0412         usb_kill_urb(portdata->out_urbs[i]);
0413     usb_kill_urb(port->interrupt_in_urb);
0414 
0415     usb_autopm_get_interface_no_resume(serial->interface);
0416 }
0417 EXPORT_SYMBOL(usb_wwan_close);
0418 
0419 static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port,
0420                       int endpoint,
0421                       int dir, void *ctx, char *buf, int len,
0422                       void (*callback) (struct urb *))
0423 {
0424     struct usb_serial *serial = port->serial;
0425     struct usb_wwan_intf_private *intfdata = usb_get_serial_data(serial);
0426     struct urb *urb;
0427 
0428     urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */
0429     if (!urb)
0430         return NULL;
0431 
0432     usb_fill_bulk_urb(urb, serial->dev,
0433               usb_sndbulkpipe(serial->dev, endpoint) | dir,
0434               buf, len, callback, ctx);
0435 
0436     if (intfdata->use_zlp && dir == USB_DIR_OUT)
0437         urb->transfer_flags |= URB_ZERO_PACKET;
0438 
0439     return urb;
0440 }
0441 
0442 int usb_wwan_port_probe(struct usb_serial_port *port)
0443 {
0444     struct usb_wwan_port_private *portdata;
0445     struct urb *urb;
0446     u8 *buffer;
0447     int i;
0448 
0449     if (!port->bulk_in_size || !port->bulk_out_size)
0450         return -ENODEV;
0451 
0452     portdata = kzalloc(sizeof(*portdata), GFP_KERNEL);
0453     if (!portdata)
0454         return -ENOMEM;
0455 
0456     init_usb_anchor(&portdata->delayed);
0457 
0458     for (i = 0; i < N_IN_URB; i++) {
0459         buffer = (u8 *)__get_free_page(GFP_KERNEL);
0460         if (!buffer)
0461             goto bail_out_error;
0462         portdata->in_buffer[i] = buffer;
0463 
0464         urb = usb_wwan_setup_urb(port, port->bulk_in_endpointAddress,
0465                         USB_DIR_IN, port,
0466                         buffer, IN_BUFLEN,
0467                         usb_wwan_indat_callback);
0468         portdata->in_urbs[i] = urb;
0469     }
0470 
0471     for (i = 0; i < N_OUT_URB; i++) {
0472         buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL);
0473         if (!buffer)
0474             goto bail_out_error2;
0475         portdata->out_buffer[i] = buffer;
0476 
0477         urb = usb_wwan_setup_urb(port, port->bulk_out_endpointAddress,
0478                         USB_DIR_OUT, port,
0479                         buffer, OUT_BUFLEN,
0480                         usb_wwan_outdat_callback);
0481         portdata->out_urbs[i] = urb;
0482     }
0483 
0484     usb_set_serial_port_data(port, portdata);
0485 
0486     return 0;
0487 
0488 bail_out_error2:
0489     for (i = 0; i < N_OUT_URB; i++) {
0490         usb_free_urb(portdata->out_urbs[i]);
0491         kfree(portdata->out_buffer[i]);
0492     }
0493 bail_out_error:
0494     for (i = 0; i < N_IN_URB; i++) {
0495         usb_free_urb(portdata->in_urbs[i]);
0496         free_page((unsigned long)portdata->in_buffer[i]);
0497     }
0498     kfree(portdata);
0499 
0500     return -ENOMEM;
0501 }
0502 EXPORT_SYMBOL_GPL(usb_wwan_port_probe);
0503 
0504 void usb_wwan_port_remove(struct usb_serial_port *port)
0505 {
0506     int i;
0507     struct usb_wwan_port_private *portdata;
0508 
0509     portdata = usb_get_serial_port_data(port);
0510     usb_set_serial_port_data(port, NULL);
0511 
0512     for (i = 0; i < N_IN_URB; i++) {
0513         usb_free_urb(portdata->in_urbs[i]);
0514         free_page((unsigned long)portdata->in_buffer[i]);
0515     }
0516     for (i = 0; i < N_OUT_URB; i++) {
0517         usb_free_urb(portdata->out_urbs[i]);
0518         kfree(portdata->out_buffer[i]);
0519     }
0520 
0521     kfree(portdata);
0522 }
0523 EXPORT_SYMBOL(usb_wwan_port_remove);
0524 
0525 #ifdef CONFIG_PM
0526 static void stop_urbs(struct usb_serial *serial)
0527 {
0528     int i, j;
0529     struct usb_serial_port *port;
0530     struct usb_wwan_port_private *portdata;
0531 
0532     for (i = 0; i < serial->num_ports; ++i) {
0533         port = serial->port[i];
0534         portdata = usb_get_serial_port_data(port);
0535         if (!portdata)
0536             continue;
0537         for (j = 0; j < N_IN_URB; j++)
0538             usb_kill_urb(portdata->in_urbs[j]);
0539         for (j = 0; j < N_OUT_URB; j++)
0540             usb_kill_urb(portdata->out_urbs[j]);
0541         usb_kill_urb(port->interrupt_in_urb);
0542     }
0543 }
0544 
0545 int usb_wwan_suspend(struct usb_serial *serial, pm_message_t message)
0546 {
0547     struct usb_wwan_intf_private *intfdata = usb_get_serial_data(serial);
0548 
0549     spin_lock_irq(&intfdata->susp_lock);
0550     if (PMSG_IS_AUTO(message)) {
0551         if (intfdata->in_flight) {
0552             spin_unlock_irq(&intfdata->susp_lock);
0553             return -EBUSY;
0554         }
0555     }
0556     intfdata->suspended = 1;
0557     spin_unlock_irq(&intfdata->susp_lock);
0558 
0559     stop_urbs(serial);
0560 
0561     return 0;
0562 }
0563 EXPORT_SYMBOL(usb_wwan_suspend);
0564 
0565 /* Caller must hold susp_lock. */
0566 static int usb_wwan_submit_delayed_urbs(struct usb_serial_port *port)
0567 {
0568     struct usb_serial *serial = port->serial;
0569     struct usb_wwan_intf_private *data = usb_get_serial_data(serial);
0570     struct usb_wwan_port_private *portdata;
0571     struct urb *urb;
0572     int err_count = 0;
0573     int err;
0574 
0575     portdata = usb_get_serial_port_data(port);
0576 
0577     for (;;) {
0578         urb = usb_get_from_anchor(&portdata->delayed);
0579         if (!urb)
0580             break;
0581 
0582         err = usb_submit_urb(urb, GFP_ATOMIC);
0583         if (err) {
0584             dev_err(&port->dev, "%s: submit urb failed: %d\n",
0585                     __func__, err);
0586             err_count++;
0587             unbusy_queued_urb(urb, portdata);
0588             usb_autopm_put_interface_async(serial->interface);
0589             continue;
0590         }
0591         data->in_flight++;
0592     }
0593 
0594     if (err_count)
0595         return -EIO;
0596 
0597     return 0;
0598 }
0599 
0600 int usb_wwan_resume(struct usb_serial *serial)
0601 {
0602     int i, j;
0603     struct usb_serial_port *port;
0604     struct usb_wwan_intf_private *intfdata = usb_get_serial_data(serial);
0605     struct usb_wwan_port_private *portdata;
0606     struct urb *urb;
0607     int err;
0608     int err_count = 0;
0609 
0610     spin_lock_irq(&intfdata->susp_lock);
0611     for (i = 0; i < serial->num_ports; i++) {
0612         port = serial->port[i];
0613 
0614         if (!tty_port_initialized(&port->port))
0615             continue;
0616 
0617         portdata = usb_get_serial_port_data(port);
0618 
0619         if (port->interrupt_in_urb) {
0620             err = usb_submit_urb(port->interrupt_in_urb,
0621                     GFP_ATOMIC);
0622             if (err) {
0623                 dev_err(&port->dev,
0624                     "%s: submit int urb failed: %d\n",
0625                     __func__, err);
0626                 err_count++;
0627             }
0628         }
0629 
0630         err = usb_wwan_submit_delayed_urbs(port);
0631         if (err)
0632             err_count++;
0633 
0634         for (j = 0; j < N_IN_URB; j++) {
0635             urb = portdata->in_urbs[j];
0636             err = usb_submit_urb(urb, GFP_ATOMIC);
0637             if (err < 0) {
0638                 dev_err(&port->dev,
0639                     "%s: submit read urb %d failed: %d\n",
0640                     __func__, i, err);
0641                 err_count++;
0642             }
0643         }
0644     }
0645     intfdata->suspended = 0;
0646     spin_unlock_irq(&intfdata->susp_lock);
0647 
0648     if (err_count)
0649         return -EIO;
0650 
0651     return 0;
0652 }
0653 EXPORT_SYMBOL(usb_wwan_resume);
0654 #endif
0655 
0656 MODULE_AUTHOR(DRIVER_AUTHOR);
0657 MODULE_DESCRIPTION(DRIVER_DESC);
0658 MODULE_LICENSE("GPL v2");