CDMA modem

Asked by Pedrosal

I have an Anydata CDMA 3G modem model ADU-BAT-100. I have a Vaio SZ laptop with Ubuntu 8.04.

In Angola we use these modems commonly as they provide the most reliable internet access.

But I cannot manage to configure this. Anydata sent me a Linux driver, but I cannot get this to work. I can post it if need be.

The Windows utility has an interface on which you press a dial button and in a few seconds the connection is running.

Is it possible to have a similar setup under Ubuntu? Without having to put in passwords, dialling numbers etc? Just a simple interface which can take me direct to my network?

I understand little about software, and have become determined to run Ubuntu to replace the Windows OS in my company. But this is one fnction I need to get to work easily.

In placing answers, I would like to request that you understand that I am really in the dark here and really not familiar with Linux.

Thank you, Pedro

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu gnome-nettool Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Brewster Malevich (brews) said :
#1

Hmmmm... I've never used anything like this...but lets see what we can do!

First, you will need to be able to use the terminal. Are you familiar with the terminal?

I'm not familiar with this modem, it connects to your computer through a USB port, yes?

Ubuntu may be able to auto-detect the modem, we want to try that before we manually install any drivers.

Revision history for this message
Pedrosal (pedro-angola-trade) said :
#2

I'm not familiar with the terminal, but I have just opened it and I should be able to manage with guidance.

Yes, the modem connects through a USB port. It is a wireless modem connecting to the internet through a cellular (mobile) phone service provider.

I tried installing ndiswrapper application. It can read the .inf file for the modem, but thereafter setting it up hasn't been possible.

The modem, in Windows, is set up by running an install application which sets up the driver but, more importantly in this case, sets up a little application where all I have to do is click on the call button and it connects to the provider. This is the crux of what I need.

Ubuntu by itself doesn't seem to be able to pick up the modem. When I use the connect to internet option which appears after I installed ndiswrapper, I see that it says the modem is present. Otherwise I have no other sign of the modem.

I had wanted to set up the wine application, but without a modem (not being able to download it in Ubuntu) I haven't been succesful.
I can download anything in Windows, but not in Ubuntu, which makes it difficult to instal things. I'm sure there must be a way.

Do you have any idea as to whether the Wine application would allow me to install the windows application and get it to connect through Ubuntu OS?

I contacted Anydate in the USA - no luck. In Korea, too, no luck. Then Anydata in China sent me a linux driver. I haven't managed to work though this.

I'll stand by for any assistance and I appreciate your reply. Thanks.

Revision history for this message
Brewster Malevich (brews) said :
#3

You should avoid using Wine unless we are absolutely sure we can't get it to work natively in Ubuntu.

Ubuntu doesn't (yet) have any documentation on using these kinds of modems, so we will have to figure out what works through trial-and-error.

As I understand, Ubuntu (and most desktop linux distributions) correctly support Anydata's ADU-E100A, and other similar modems. Plug the modem into the usb port and restart ubuntu. When you restart, hotplug will detect the device and assign the USB port to your modem. This means that we shouldn't need to manually install drivers.

Nobody is comfortable with the terminal at first, but it is fairly easy to use with a few simple commands and is extremely powerful. (To learn more look into the help documents at 'System'=>'Help and Support'. In the window that pops up, scroll down and on the left hand side, click "Advanced Topics". This is a good introduction to the command line)

Now that we have restarted the computer with the modem plugged in, open a terminal. Type in:
sudo apt-get install gnome-ppp

There are to parts to this command:
The first part of this command, "sudo", gives us root access. Root is roughly equivalent to Microsoft's "Administrator". Be careful when doing anything in Root or with "sudo" because it gives access to your -entire- computer system. The second part of this command uses the program "apt-get" to install the package "gnome-ppp". (An easier way for you may be to use "Synaptic Package Manager" in the 'System'=>'Administration' menu).

gnome-ppp is a friendly GUI (Graphic User Interface) frontend to the WVDial program. Access it either by typing "gnome-ppp" in the terminal, or by finding it in the 'Applications'=>'Internet' menu. This is what you use to connect to the internet through dial-ups. I think we may be able to use it with your modem. If it doesn't work, we can try other options.

Go ahead and open gnome-ppp.
In the window that pops up, click the "Setup" button and a new window will come up. In this window, under the "Modem" section, try the "detect" button and see if it detects your modem.

Let me know how this works for you.

Revision history for this message
Brewster Malevich (brews) said :
#4

I realize that I may have made the mistake of assuming that Ubuntu is connected to the internet.

I am sorry for my bad answer. I'm writing a new answer.

Revision history for this message
Pedrosal (pedro-angola-trade) said :
#5

Hi there,

No problem on the first answer. I downloaded gnome-ppp through windows because I didn't have it installed. Installed it ok, but it can't pick up a modem.

I plugged in the modem before booting up.

In gnome-ppp I ran a search for it under device (/dev/modem; /dev/ttyS0, /dev/ttyS1, 2, 3) but it didn't detect any modem. I also tried varying the detect for different types, including USB modem.

So until now not much success.

Is it possible to upload on this forum? I could send you the driver from the manufacturer if you need. It doesn't install though. I have tried various methods.

Revision history for this message
Brewster Malevich (brews) said :
#6

No, unfortunately you cannot upload files onto the Answers section.

I understand that you are running Ubuntu 8.04, when did you install this version and how did you install it? If need be, could you download a new disk image and reinstall?

Start Ubuntu. Plug in the modem. Now open a terminal and type:
tail -f /var/log/messages

In the output of that command look for anything about a modem connecting to USB. It may look something like:

"Jul 20 21:53:55 localhost kernel: usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0 "

And paste it onto a message here, if you can.

We want to be sure that the computer knows something is being connected to the USB port.

Revision history for this message
Pedrosal (pedro-angola-trade) said :
#7

Yes, it's 8.04. I downloaded and installed over the weekend. I could download the complete version if necessary, but probably only next week - limits on internet account should be reaching end.

Something is being recognised - here goes the log text (I unplugged the modem a few times and also plugged it into the second usb port - there are two):
Apr 25 00:41:11 swlltd-laptop pulseaudio[5941]: alsa-util.c: Cannot find fallback mixer control "Mic".
Apr 25 00:45:19 swlltd-laptop kernel: [ 345.063798] usb 3-1: USB disconnect, address 2
Apr 25 00:45:24 swlltd-laptop kernel: [ 349.843528] usb 3-1: new full speed USB device using uhci_hcd and address 3
Apr 25 00:45:24 swlltd-laptop kernel: [ 350.056394] usb 3-1: configuration #1 chosen from 1 choice
Apr 25 00:45:37 swlltd-laptop kernel: [ 363.136584] usb 3-1: USB disconnect, address 3
Apr 25 00:45:40 swlltd-laptop kernel: [ 366.127365] usb 4-1: new full speed USB device using uhci_hcd and address 2
Apr 25 00:45:41 swlltd-laptop kernel: [ 366.340233] usb 4-1: configuration #1 chosen from 1 choice
Apr 25 00:47:49 swlltd-laptop kernel: [ 494.846064] usb 4-1: USB disconnect, address 2
Apr 25 00:47:53 swlltd-laptop kernel: [ 498.127352] usb 3-1: new full speed USB device using uhci_hcd and address 4
Apr 25 00:47:53 swlltd-laptop kernel: [ 498.286311] usb 3-1: configuration #1 chosen from 1 choice

Revision history for this message
Brewster Malevich (brews) said :
#8

Alright.
The linux driver for this device:

Did it come with a "Read me" file?

Can you open the linux driver as though it was a text file (for example with Gedit ('Applications'=>'Accessories'))?

If you can open it as a text file, could you paste it here as a message?

Revision history for this message
Pedrosal (pedro-angola-trade) said :
#9

The file is specifically for Linux Red Hat 9- 2.4.20.

Its name is anydata.tar.gz, and contains five components: anydata.c, anydata.h, makefile, run.sh and usb-serial.h. I'll make a separate post here for each of the contents starting with anytada.c

ANYDATA.C CONTENTS:

#include <linux/config.h>

#include <linux/kernel.h>

#include <linux/sched.h>

#include <linux/signal.h>

#include <linux/errno.h>

#include <linux/poll.h>

#include <linux/init.h>

#include <linux/slab.h>

#include <linux/fcntl.h>

#include <linux/tty.h>

#include <linux/tty_driver.h>

#include <linux/tty_flip.h>

#include <linux/module.h>

#include <linux/spinlock.h>

#include <linux/list.h>

#include <linux/smp_lock.h>

#include <linux/usb.h>

#include <linux/fs.h>

#include <asm/io.h>

#include <asm/uaccess.h>

#include <linux/stat.h>

#include <linux/proc_fs.h>

//#define CONFIG_USB_SERIAL_DEBUG //cmpark

#ifdef CONFIG_USB_SERIAL_DEBUG

 static int debug = 1;

#else

 static int debug;

#endif

//static int debug = 1;

#include "usb-serial.h"

#include "anydata.h"

/*

 * Version Information

 */

#define DRIVER_VERSION "v1.0"

#define DRIVER_AUTHOR "khj"

#define DRIVER_DESC "Anydata CDMA modem driver"

/*

 * LED

 */

/*

#define ADM5120

#ifdef ADM5120

#include "leds.h"

#define TIMEOUT (2*HZ/10)

struct timer_list timer;

struct proc_dir_entry *onframe_root_fp = NULL;

struct proc_dir_entry *onframe_val_fp = NULL;

char onframe_str[PAGE_SIZE-80] = {0,};

int read_onframe_val(char *page,char **start,off_t off, int count ,int *eof, void *data_unused)

{

 char *buf;

 char *realdata;

 realdata = (char *)data_unused;

 buf = page;

 buf+= sprintf(buf,"%s\n",realdata);

 *eof =1;

 return buf -page;

}

int write_onframe_val(struct file *file , const char *buffer, unsigned long count , void *data)

{

 int len;

 char *realdata;

 realdata = (char *)data;

 if(copy_from_user(realdata,buffer,count))

  return -EFAULT;

 realdata[count] = '\0';

 len = strlen(realdata);

 if(realdata[len-1] == '\n')

  realdata[--len] =0;

 return count;

}

void OnTimer(unsigned long arg);

void kerneltimer_register(unsigned long timeover)

{

        init_timer(&timer);

        timer.expires = jiffies + timeover;

        timer.data = 0;

        timer.function = OnTimer;

        add_timer(&timer);

}

void OnTimer(unsigned long arg)

{

        LED_ON(GPIO_CDMA);

        kerneltimer_register(TIMEOUT);

}

#endif

*/

static int state = 0;

static int acm_ctrl_msg(struct usb_serial * serial, int request, int value, void* buf,int len)

{

 int retval = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev,0),

   request, USB_RT_ACM, value, 0, buf,len,HZ*5);

 return retval < 0 ? retval : 0;

}

#define acm_set_control(acm,control) acm_ctrl_msg(acm,ACM_REQ_SET_CONTROL,control,NULL,0)

#define acm_set_line(acm,line) acm_ctrl_msg(acm,ACM_REQ_SET_LINE,0,line,sizeof(struct acm_line))

#define acm_send_break(acm,ms) acm_ctrl_msg(acm,ACM_REQ_SEND_BREAK,ms,NULL,0)

// function prototypes for anydata

static int anydata_startup(struct usb_serial* serial);

static void anydata_set_termios(struct usb_serial_port *port, struct termios *old);

static int anydata_ioctl(struct usb_serial_port *port, struct file *file,unsigned int cmd, unsigned long arg);

static void anydata_break_ctl(struct usb_serial_port *port, int break_state);

/* function prototypes for a "generic" type serial converter (no flow control, not all endpoints needed) */

/* need to always compile these in, as some of the other devices use these functions as their own. */

/* if a driver does not provide a function pointer, the generic function will be called. */

static int generic_open (struct usb_serial_port *port, struct file *filp);

static void generic_close (struct usb_serial_port *port, struct file *filp);

static int generic_write (struct usb_serial_port *port, int from_user, const unsigned char *buf, int count);

static int generic_write_room (struct usb_serial_port *port);

static int generic_chars_in_buffer (struct usb_serial_port *port);

static void generic_read_bulk_callback (struct urb *urb);

static void generic_write_bulk_callback (struct urb *urb);

static void generic_int_callback (struct urb *urb); // khj 0919

static void generic_shutdown (struct usb_serial *serial);

static __u16 vendor = 0x16d5;

static __u16 product = 0x6501; // NULL modem

//static __u16 vendor = 0x16d5;

//static __u16 product = 0x3198; // SKY modem

static __u16 product1 = 0x6502;

static struct usb_device_id generic_device_ids[] = {

// {USB_DEVICE(0x10a9,0x3198)},//SKY modem

 {USB_DEVICE(0x16d5,0x6501)},//NULL modem

 {USB_DEVICE(0x16d5,0x6502)},

 {}

};

MODULE_DEVICE_TABLE(usb,generic_device_ids);

  /* Initially all zeroes. */

/* All of the device info needed for the Generic Serial Converter */

static struct usb_serial_device_type generic_device = {

 .owner = THIS_MODULE,

 .name = "Anydata",

 .id_table = generic_device_ids,

 .num_interrupt_in = NUM_DONT_CARE,

 .num_bulk_in = NUM_DONT_CARE,

 .num_bulk_out = NUM_DONT_CARE,

 .num_ports = 1,

 .ioctl = anydata_ioctl,

 .set_termios = anydata_set_termios,

 .break_ctl = anydata_break_ctl,

 .startup = anydata_startup,

 .shutdown = generic_shutdown,

};

struct anydata_private

{

 struct acm_line line;

 unsigned int ctrlin;

 unsigned int ctrlout;

};

static int anydata_startup(struct usb_serial *serial)

{

 serial->port->private = kmalloc(sizeof(struct anydata_private), GFP_KERNEL);

 if(!serial->port->private)

 {

  //printk(KERN_INFO"mem allocate error\n");

  return -1;

 }

 dbg("%s\n",__FUNCTION__);//cmpark

 return (0);

}

static int anydata_ioctl(struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg)

{

 struct usb_serial * serial = port->serial;

 struct anydata_private * priv = (struct anydata_private*)port->private;

 unsigned int mask=0x00, newctrl=0x00;

 //printk("FUNCTION=%s CMD= %0x arg = %0x\n",__FUNCTION__, cmd , arg);//cmpark

 //printk("TIOCMGET=%0x TIOCMSET=%0x TIOCMBIS=%0x TIOCMBIC=%0x\n",TIOCMGET, TIOCMSET, TIOCMBIS, TIOCMBIC);

 switch(cmd)

 {

 case TIOCMGET:

  //printk("\nTIOCMGET run!\n");

  return put_user( (priv->ctrlout & ACM_CTRL_DTR ? TIOCM_DTR : 0) |

   (priv->ctrlout & ACM_CTRL_RTS ? TIOCM_RTS : 0) |

   (priv->ctrlin & ACM_CTRL_DSR ? TIOCM_DSR : 0) |

   (priv->ctrlin & ACM_CTRL_RI ? TIOCM_RI : 0) |

   (priv->ctrlin & ACM_CTRL_DCD ? TIOCM_CD : 0 ) |

   TIOCM_CTS,(unsigned long *)arg);

 case TIOCMSET:

 // dbg("\nTIOCMSET run!\n");

 case TIOCMBIS:

 // dbg("\nTIOCMBIS run!\n");

 case TIOCMBIC:

 // dbg("\nTIOCMBIC run!\n");

  if(get_user(mask,(unsigned long *)arg))

   return -EFAULT;

  newctrl = priv->ctrlout;

  mask = (mask & TIOCM_DTR ? ACM_CTRL_DTR : 0) | (mask & TIOCM_RTS ? ACM_CTRL_RTS : 0);

  switch(cmd)

  {

  case TIOCMSET: newctrl = mask ; break;

  case TIOCMBIS: newctrl |= mask; break;

  case TIOCMBIC: newctrl &= ~mask; break;

  }

  if(priv->ctrlout == newctrl) return 0;

  return acm_set_control(serial, priv->ctrlout = newctrl);

 case 0xABCD:

  mask = 0x21;

  newctrl |= mask;

  return acm_set_control(serial, priv->ctrlout = newctrl);

 }

 return -ENOIOCTLCMD;

}

static __u32 acm_tty_speed[] = {

 0,50,75,110,134,150,200,300,600,

 1200,1800,2400,9600,19200,38400,

 57600,115200,230400,460800,500000,576000,

 921600,1000000,1152000,1500000,2000000,

 2500000,3000000,3500000,4000000

};

static __u8 acm_tty_size[] = {

 5,6,7,8

};

static void anydata_set_termios(struct usb_serial_port* port, struct termios* old_termios)

{

 struct usb_serial* serial = port->serial;

 struct anydata_private * priv = (struct anydata_private*)port->private;

 struct termios* termios = port->tty->termios;

 struct acm_line newline;

 int newctrl = priv->ctrlout;

 if( (!port->tty) || (!port->tty->termios))

 {

  printk(KERN_INFO"%s - no tty or termios structure\n",__FUNCTION__);

  return;

 }

 dbg("%s\n",__FUNCTION__);//cmpark

 newline.speed = cpu_to_le32p(acm_tty_speed +

  (termios->c_cflag & CBAUD & ~CBAUDEX) + (termios->c_cflag & CBAUDEX ? 15 : 0));

 newline.stopbits = termios->c_cflag & CSTOPB ? 2 : 0 ;

 newline.parity = termios->c_cflag & PARENB ?

  (termios->c_cflag & PARODD ? 1:2 ) + (termios->c_cflag & CMSPAR ? 2:0) : 0;

 newline.databits = acm_tty_size[(termios->c_cflag & CSIZE) >> 4];

 if(!newline.speed)

 {

  newline.speed = priv->line.speed;

  newctrl &= ~ACM_CTRL_DTR;

 }else newctrl |= ACM_CTRL_DTR;

 if(newctrl != priv->ctrlout)

  acm_set_control(serial, priv->ctrlout = newctrl);

 if(memcmp(&priv->line , &newline, sizeof(struct acm_line)))

 {

  memcpy(&priv->line, &newline, sizeof(struct acm_line));

  acm_set_line (serial, &priv->line);

 }

}

static void anydata_break_ctl(struct usb_serial_port * port, int break_state)

{

 struct usb_serial *serial = port->serial;

 if(acm_send_break(serial, break_state ? 0xffff : 0 ))

 {

  printk(KERN_INFO"send break failed\n");

  printk(KERN_INFO"break_state = 0x%2.2X\n",break_state);

 }

 //debug

 else

 {

  printk(KERN_INFO"func : anydata_break_ctl(..) call acm_send_break() success!\n");

 }

}

/* local function prototypes */

static int serial_open (struct tty_struct *tty, struct file * filp);

static void serial_close (struct tty_struct *tty, struct file * filp);

static int serial_write (struct tty_struct * tty, int from_user, const unsigned char *buf, int count);

static int serial_write_room (struct tty_struct *tty);

static int serial_chars_in_buffer (struct tty_struct *tty);

static void serial_throttle (struct tty_struct * tty);

static void serial_unthrottle (struct tty_struct * tty);

static int serial_ioctl (struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg);

static void serial_set_termios (struct tty_struct *tty, struct termios * old);

static void serial_shutdown (struct usb_serial *serial);

static void * usb_serial_probe(struct usb_device *dev, unsigned int ifnum,

          const struct usb_device_id *id);

static void usb_serial_disconnect(struct usb_device *dev, void *ptr);

static struct usb_driver usb_serial_driver = {

 .name = "serial",

 .probe = usb_serial_probe,

 .disconnect = usb_serial_disconnect,

 .id_table = NULL, /* check all devices */

};

/* There is no MODULE_DEVICE_TABLE for usbserial.c. Instead

   the MODULE_DEVICE_TABLE declarations in each serial driver

   cause the "hotplug" program to pull in whatever module is necessary

   via modprobe, and modprobe will load usbserial because the serial

   drivers depend on it.

*/

static int serial_refcount;

static struct tty_driver serial_tty_driver;

static struct tty_struct * serial_tty[SERIAL_TTY_MINORS];

static struct termios * serial_termios[SERIAL_TTY_MINORS];

static struct termios * serial_termios_locked[SERIAL_TTY_MINORS];

static struct usb_serial *serial_table[SERIAL_TTY_MINORS]; /* initially all NULL */

static LIST_HEAD(usb_serial_driver_list);

static struct usb_serial *get_serial_by_minor (unsigned int minor)

{

 return serial_table[minor];

}

static struct usb_serial *get_free_serial (int num_ports, int *minor)

{

 struct usb_serial *serial = NULL;

 int i, j;

 int good_spot;

 dbg("%s num_ports=%d", __FUNCTION__, num_ports);

 *minor = 0;

 for (i = 0; i < SERIAL_TTY_MINORS; ++i) {

  if (serial_table[i])

   continue;

  good_spot = 1;

  for (j = 1; j <= num_ports-1; ++j)

   if (serial_table[i+j])

    good_spot = 0;

  if (good_spot == 0)

   continue;

  if (!(serial = kmalloc(sizeof(struct usb_serial), GFP_KERNEL))) {

   err("%s - Out of memory", __FUNCTION__);

   return NULL;

  }

  memset(serial, 0, sizeof(struct usb_serial));

  serial->magic = USB_SERIAL_MAGIC;

  serial_table[i] = serial;

  *minor = i;

  dbg("%s - minor base = %d", __FUNCTION__, *minor);

  for (i = *minor+1; (i < (*minor + num_ports)) && (i < SERIAL_TTY_MINORS); ++i)

   serial_table[i] = serial;

  return serial;

 }

 return NULL;

}

static void return_serial (struct usb_serial *serial)

{

 int i;

 dbg("%s", __FUNCTION__);

 if (serial == NULL)

  return;

 for (i = 0; i < serial->num_ports; ++i) {

  serial_table[serial->minor + i] = NULL;

 }

 return;

}

/*****************************************************************************

 * Driver tty interface functions

 *****************************************************************************/

static int serial_open (struct tty_struct *tty, struct file * filp)

{

 struct usb_serial *serial;

 struct usb_serial_port *port;

 unsigned int portNumber;

 int retval = 0;

 dbg("%s", __FUNCTION__);

 /* initialize the pointer incase something fails */

 tty->driver_data = NULL;

 /* get the serial object associated with this tty pointer */

 serial = get_serial_by_minor (MINOR(tty->device));

 if (serial_paranoia_check (serial, __FUNCTION__))

  return -ENODEV;

 /* set up our port structure making the tty driver remember our port object, and us it */

 portNumber = MINOR(tty->device) - serial->minor;

 port = &serial->port[portNumber];

 tty->driver_data = port;

 down (&port->sem);

 port->tty = tty;

 /* lock this module before we call it */

 if (serial->type->owner)

  __MOD_INC_USE_COUNT(serial->type->owner);

 ++port->open_count;

 if (port->open_count == 1) {

  /* only call the device specific open if this

   * is the first time the port is opened */

  if (serial->type->open)

   retval = serial->type->open(port, filp);

  else

   retval = generic_open(port, filp);

 }

 if (retval) {

  port->open_count = 0;

  if (serial->type->owner)

   __MOD_DEC_USE_COUNT(serial->type->owner);

 }

 up (&port->sem);

 return retval;

}

static void __serial_close(struct usb_serial_port *port, struct file *filp)

{

 if (!port->open_count) {

  dbg ("%s - port not opened", __FUNCTION__);

  return;

 }

 --port->open_count;

 if (port->open_count <= 0) {

  /* only call the device specific close if this

   * port is being closed by the last owner */

  if (port->serial->type->close)

   port->serial->type->close(port, filp);

  else

   generic_close(port, filp);

  port->open_count = 0;

 }

 if (port->serial->type->owner)

  __MOD_DEC_USE_COUNT(port->serial->type->owner);

}

static void serial_close(struct tty_struct *tty, struct file * filp)

{

 struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;

 struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);

 if (!serial)

  return;

 down (&port->sem);

 dbg("%s - port %d", __FUNCTION__, port->number);

 /* if disconnect beat us to the punch here, there's nothing to do */

 if (tty->driver_data) {

  __serial_close(port, filp);

 }

 up (&port->sem);

}

static int serial_write (struct tty_struct * tty, int from_user, const unsigned char *buf, int count)

{

 struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;

 struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);

 int retval = -EINVAL;

 //printk("SERIAL WRITE\n");

 if (!serial)

  return -ENODEV;

 down (&port->sem);

 //printk("serial write 2 \n");

 //printk("%s - port %d, %d byte(s)\n", __FUNCTION__, port->number, count);

 if (!port->open_count) {

  dbg("%s - port not opened", __FUNCTION__);

  goto exit;

 }

 /* pass on to the driver specific version of this function if it is available */

 if (serial->type->write)

  retval = serial->type->write(port, from_user, buf, count);

 else

  retval = generic_write(port, from_user, buf, count);

exit:

 up (&port->sem);

 return retval;

}

static int serial_write_room (struct tty_struct *tty)

{

 struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;

 struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);

 int retval = -EINVAL;

 if (!serial)

  return -ENODEV;

 down (&port->sem);

 dbg("%s - port %d", __FUNCTION__, port->number);

 if (!port->open_count) {

  dbg("%s - port not open", __FUNCTION__);

  goto exit;

 }

 /* pass on to the driver specific version of this function if it is available */

 if (serial->type->write_room)

  retval = serial->type->write_room(port);

 else

  retval = generic_write_room(port);

exit:

 up (&port->sem);

 return retval;

}

static int serial_chars_in_buffer (struct tty_struct *tty)

{

 struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;

 struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);

 int retval = -EINVAL;

 if (!serial)

  return -ENODEV;

 down (&port->sem);

 dbg("%s = port %d", __FUNCTION__, port->number);

 if (!port->open_count) {

  dbg("%s - port not open", __FUNCTION__);

  goto exit;

 }

 /* pass on to the driver specific version of this function if it is available */

 if (serial->type->chars_in_buffer)

  retval = serial->type->chars_in_buffer(port);

 else

  retval = generic_chars_in_buffer(port);

exit:

 up (&port->sem);

 return retval;

}

static void serial_throttle (struct tty_struct * tty)

{

 struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;

 struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);

 if (!serial)

  return;

 down (&port->sem);

 dbg("%s - port %d", __FUNCTION__, port->number);

 if (!port->open_count) {

  dbg ("%s - port not open", __FUNCTION__);

  goto exit;

 }

 /* pass on to the driver specific version of this function */

 if (serial->type->throttle)

  serial->type->throttle(port);

exit:

 up (&port->sem);

}

static void serial_unthrottle (struct tty_struct * tty)

{

 struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;

 struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);

 if (!serial)

  return;

 down (&port->sem);

 dbg("%s - port %d", __FUNCTION__, port->number);

 if (!port->open_count) {

  dbg("%s - port not open", __FUNCTION__);

  goto exit;

 }

 /* pass on to the driver specific version of this function */

 if (serial->type->unthrottle)

  serial->type->unthrottle(port);

exit:

 up (&port->sem);

}

static int serial_ioctl (struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg)

{

 struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;

 struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);

 int retval = -ENODEV;

 if (!serial)

  return -ENODEV;

 down (&port->sem);

 dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd);

 if (!port->open_count) {

  dbg ("%s - port not open", __FUNCTION__);

  goto exit;

 }

 /* pass on to the driver specific version of this function if it is available */

 if (serial->type->ioctl)

  retval = serial->type->ioctl(port, file, cmd, arg);

 else

  retval = -ENOIOCTLCMD;

exit:

 up (&port->sem);

 return retval;

}

static void serial_set_termios (struct tty_struct *tty, struct termios * old)

{

 struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;

 struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);

 if (!serial)

  return;

 down (&port->sem);

 dbg("%s - port %d", __FUNCTION__, port->number);

 if (!port->open_count) {

  dbg("%s - port not open", __FUNCTION__);

  goto exit;

 }

 /* pass on to the driver specific version of this function if it is available */

 if (serial->type->set_termios)

  serial->type->set_termios(port, old);

exit:

 up (&port->sem);

}

static void serial_break (struct tty_struct *tty, int break_state)

{

 struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;

 struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);

 if (!serial)

  return;

 down (&port->sem);

 dbg("%s - port %d", __FUNCTION__, port->number);

 if (!port->open_count) {

  dbg("%s - port not open", __FUNCTION__);

  goto exit;

 }

 /* pass on to the driver specific version of this function if it is available */

 if (serial->type->break_ctl)

  serial->type->break_ctl(port, break_state);

exit:

 up (&port->sem);

}

static void serial_shutdown (struct usb_serial *serial)

{

 dbg ("%s", __FUNCTION__);

 if (serial->type->shutdown)

  serial->type->shutdown(serial);

 else

  generic_shutdown(serial);

}

static int serial_read_proc (char *page, char **start, off_t off, int count, int *eof, void *data)

{

 struct usb_serial *serial;

 int length = 0;

 int i;

 off_t begin = 0;

 char tmp[40];

 dbg("%s", __FUNCTION__);

 length += sprintf (page, "usbserinfo:1.0 driver:%s\n", DRIVER_VERSION);

 for (i = 0; i < SERIAL_TTY_MINORS && length < PAGE_SIZE; ++i) {

  serial = get_serial_by_minor(i);

  if (serial == NULL)

   continue;

  length += sprintf (page+length, "%d:", i);

  if (serial->type->owner)

   length += sprintf (page+length, " module:%s", serial->type->owner->name);

  length += sprintf (page+length, " name:\"%s\"", serial->type->name);

  length += sprintf (page+length, " vendor:%04x product:%04x", serial->vendor, serial->product);

  length += sprintf (page+length, " num_ports:%d", serial->num_ports);

  length += sprintf (page+length, " port:%d", i - serial->minor + 1);

  usb_make_path(serial->dev, tmp, sizeof(tmp));

  length += sprintf (page+length, " path:%s", tmp);

  length += sprintf (page+length, "\n");

  if ((length + begin) > (off + count))

   goto done;

  if ((length + begin) < off) {

   begin += length;

   length = 0;

  }

 }

 *eof = 1;

done:

 if (off >= (length + begin))

  return 0;

 *start = page + (off-begin);

 return ((count < begin+length-off) ? count : begin+length-off);

}

/*****************************************************************************

 * generic devices specific driver functions

 *****************************************************************************/

static int generic_open (struct usb_serial_port *port, struct file *filp)

{

 struct usb_serial *serial = port->serial;

 int result = 0;

 struct anydata_private* priv;

 priv = (struct anydata_private*)port->private;

 if (port_paranoia_check (port, __FUNCTION__))

  return -ENODEV;

 dbg("%s - port %d", __FUNCTION__, port->number);

 /* force low_latency on so that our tty_push actually forces the data through,

    otherwise it is scheduled, and with high data rates (like with OHCI) data

    can get lost. */

 if (port->tty)

  port->tty->low_latency = 1;

 /* if we have a bulk interrupt, start reading from it */

 if (serial->num_bulk_in) {

  /* Start reading from the device */

  usb_fill_bulk_urb (port->read_urb, serial->dev,

       usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),

       port->read_urb->transfer_buffer,

       port->read_urb->transfer_buffer_length,

       ((serial->type->read_bulk_callback) ?

         serial->type->read_bulk_callback :

         generic_read_bulk_callback),

       port);

  result = usb_submit_urb(port->read_urb);

  if (result)

   err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);

 }

 acm_set_control(serial, priv->ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS);

 return result;

}

static void generic_cleanup (struct usb_serial_port *port)

{

 struct usb_serial *serial = port->serial;

 struct anydata_private *priv;

 priv = (struct anydata_private*)port->private;

 dbg("%s - port %d", __FUNCTION__, port->number);

 if (serial->dev) {

  /* shutdown any bulk reads that might be going on */

  if (serial->num_bulk_out)

   usb_unlink_urb (port->write_urb);

  if (serial->num_bulk_in)

   usb_unlink_urb (port->read_urb);

  acm_set_control(serial, priv->ctrlout = 0);

 }

}

static void generic_close (struct usb_serial_port *port, struct file * filp)

{

 dbg("%s - port %d", __FUNCTION__, port->number);

 generic_cleanup (port);

}

static int generic_write (struct usb_serial_port *port, int from_user, const unsigned char *buf, int count)

{

 struct usb_serial *serial = port->serial;

 int result;

 //printk("%s - port %d", __FUNCTION__, port->number);

// sprintf(onframe_val_fp->data,"%s\n","onframe=\"YES\"");

 if (count == 0) {

  return (0);

 }

 /* only do something if we have a bulk out endpoint */

 if (serial->num_bulk_out) {

  if (port->write_urb->status == -EINPROGRESS) {

   //printk("%s - already writing", __FUNCTION__);

   return (0);

  }

  count = (count > port->bulk_out_size) ? port->bulk_out_size : count;

  if (from_user) {

   if (copy_from_user(port->write_urb->transfer_buffer, buf, count))

    return -EFAULT;

  }

  else {

   memcpy (port->write_urb->transfer_buffer, buf, count);

  }

/*

#ifdef ADM5120

 LED_TOGGLE(GPIO_CDMA);

#endif*/

  //usb_serial_debug_data (__FILE__, __FUNCTION__, count, port->write_urb->transfer_buffer);

  //printk("transfer_flags : %x\n",port->write_urb->transfer_flags);

  /* set up our urb */

  usb_fill_bulk_urb (port->write_urb, serial->dev,

       usb_sndbulkpipe (serial->dev,

          port->bulk_out_endpointAddress),

       port->write_urb->transfer_buffer, count,

         generic_write_bulk_callback, port);

  //printk("usb_fill_bulk_urb WRITE\n");

  /* send the data out the bulk port */

  result = usb_submit_urb(port->write_urb);

  if (result)

  {

       //printk("GENERIC WRITE ERR\n");

       printk("%s - failed submitting write urb, error %d", __FUNCTION__, result);

  }

  else

   result = count;

  return result;

 }

 /* no bulk out, so return 0 bytes written */

 return (0);

}

static int generic_write_room (struct usb_serial_port *port)

{

 struct usb_serial *serial = port->serial;

 int room = 0;

 dbg("%s - port %d", __FUNCTION__, port->number);

 if (serial->num_bulk_out) {

  if (port->write_urb->status != -EINPROGRESS)

   room = port->bulk_out_size;

 }

 dbg("%s - returns %d", __FUNCTION__, room);

 return (room);

}

static int generic_chars_in_buffer (struct usb_serial_port *port)

{

 struct usb_serial *serial = port->serial;

 int chars = 0;

 dbg("%s - port %d", __FUNCTION__, port->number);

 if (serial->num_bulk_out) {

  if (port->write_urb->status == -EINPROGRESS)

   chars = port->write_urb->transfer_buffer_length;

 }

 dbg("%s - returns %d", __FUNCTION__, chars);

 return (chars);

}

static void generic_read_bulk_callback (struct urb *urb)

{

 struct usb_serial_port *port = (struct usb_serial_port *)urb->context;

 struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);

 struct tty_struct *tty;

 unsigned char *data = urb->transfer_buffer;

 int i;

 int result;

// static int count=1;

// sprintf(onframe_val_fp->data,"%d",1);

// printk("read_bulk_callback = %d\n",count);

 if (!serial) {

  printk("%s - bad serial pointer, exiting\n", __FUNCTION__);

  return;

 }

 if (urb->status) {

  printk("%s - nonzero read bulk status received: %d\n", __FUNCTION__, urb->status);

  return;

 }

/*

#ifdef ADM5120

 LED_TOGGLE(GPIO_CDMA);

#endif

 //usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);

*/

 tty = port->tty;

 if (tty && urb->actual_length) {

  for (i = 0; i < urb->actual_length ; ++i) {

   /* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */

   if(tty->flip.count >= TTY_FLIPBUF_SIZE) {

    tty_flip_buffer_push(tty);

   }

   /* this doesn't actually push the data through unless tty->low_latency is set */

   tty_insert_flip_char(tty, data[i], 0);

  }

    tty_flip_buffer_push(tty);

 }

 /* Continue trying to always read */

 //printk(KERN_INFO"[khj] read_bulk_callback : buffer_length: %d\n",port->read_urb->transfer_buffer_length);

 usb_fill_bulk_urb (port->read_urb, serial->dev,

      usb_rcvbulkpipe (serial->dev,

            port->bulk_in_endpointAddress),

      port->read_urb->transfer_buffer,

      port->read_urb->transfer_buffer_length,

      ((serial->type->read_bulk_callback) ?

        serial->type->read_bulk_callback :

        generic_read_bulk_callback), port);

 //printk("usb_fill_bulk_urb READ\n");

 //port->read_urb->actual_length = 0;

 //port->read_urb->dev = serial->dev;

 result = usb_submit_urb(port->read_urb);

 if (result)

  printk("%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);

}

//khj 0919

static void generic_int_callback(struct urb * urb)

{

 printk(KERN_INFO"in generic int callback\n");

}

static void generic_write_bulk_callback (struct urb *urb)

{

 struct usb_serial_port *port = (struct usb_serial_port *)urb->context;

 struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);

 dbg("%s - port %d", __FUNCTION__, port->number);

   //sprintf(onframe_val_fp->data,"%s\n","onframe=\"YES\"");

 if (!serial) {

  dbg("%s - bad serial pointer, exiting", __FUNCTION__);

  return;

 }

 if (urb->status) {

  printk("%s - nonzero write bulk status received: %d\n", __FUNCTION__, urb->status);

  return;

 }

 queue_task(&port->tqueue, &tq_immediate);

 mark_bh(IMMEDIATE_BH);

 return;

}

static void generic_shutdown (struct usb_serial *serial)

{

 int i;

 dbg("%s", __FUNCTION__);

 /* stop reads and writes on all ports */

 for (i=0; i < serial->num_ports; ++i) {

  generic_cleanup (&serial->port[i]);

  if(serial->port[i].private)

   kfree(serial->port[i].private);

 }

}

static void port_softint(void *private)

{

 struct usb_serial_port *port = (struct usb_serial_port *)private;

 struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);

 struct tty_struct *tty;

 dbg("%s - port %d", __FUNCTION__, port->number);

 if (!serial)

  return;

 tty = port->tty;

 if (!tty)

  return;

 if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup) {

  dbg("%s - write wakeup call.", __FUNCTION__);

  (tty->ldisc.write_wakeup)(tty);

 }

 wake_up_interruptible(&tty->write_wait);

}

static void * usb_serial_probe(struct usb_device *dev, unsigned int ifnum,

          const struct usb_device_id *id)

{

 struct usb_serial *serial = NULL;

 struct usb_serial_port *port;

 struct usb_interface *interface;

 struct usb_interface_descriptor *iface_desc;

 struct usb_endpoint_descriptor *endpoint;

 struct usb_endpoint_descriptor *interrupt_in_endpoint[MAX_NUM_PORTS];

 struct usb_endpoint_descriptor *bulk_in_endpoint[MAX_NUM_PORTS];

 struct usb_endpoint_descriptor *bulk_out_endpoint[MAX_NUM_PORTS];

 struct usb_serial_device_type *type = NULL;

 struct anydata_private *priv;

 struct list_head *tmp;

 int found;

 int minor;

 int buffer_size;

 int i;

 int num_interrupt_in = 0;

 int num_bulk_in = 0;

 int num_bulk_out = 0;

 int num_ports;

 int max_endpoints;

 const struct usb_device_id *id_pattern = NULL;

 /* loop through our list of known serial converters, and see if this

    device matches. */

 if(ifnum != 0 ) return (NULL);

 found = 0;

 interface = &dev->actconfig->interface[ifnum];

 list_for_each (tmp, &usb_serial_driver_list) {

  type = list_entry(tmp, struct usb_serial_device_type, driver_list);

  id_pattern = usb_match_id(dev, interface, type->id_table);

  if (id_pattern != NULL) {

   dbg("descriptor matches");

   found = 1;

   break;

  }

 }

 if (!found) {

  /* no match */

  dbg("none matched");

  return(NULL);

 }

 /* descriptor matches, let's find the endpoints needed */

 /* check out the endpoints */

 iface_desc = &interface->altsetting[0];

 dbg("%s interface=%d numendpoint =%d \n", __FUNCTION__, ifnum,iface_desc->bNumEndpoints);//cmpark

 for (i = 0; i < iface_desc->bNumEndpoints; ++i) {

  endpoint = &iface_desc->endpoint[i];

  if ((endpoint->bEndpointAddress & 0x80) &&

      ((endpoint->bmAttributes & 3) == 0x02)) {

   /* we found a bulk in endpoint */

   dbg("found bulk in");

   bulk_in_endpoint[num_bulk_in] = endpoint;

   ++num_bulk_in;

  }

  if (((endpoint->bEndpointAddress & 0x80) == 0x00) &&

      ((endpoint->bmAttributes & 3) == 0x02)) {

   /* we found a bulk out endpoint */

   dbg("found bulk out");

   bulk_out_endpoint[num_bulk_out] = endpoint;

   ++num_bulk_out;

  }

  if ((endpoint->bEndpointAddress & 0x80) &&

      ((endpoint->bmAttributes & 3) == 0x03)) {

   /* we found a interrupt in endpoint */

   dbg("found interrupt in");

   interrupt_in_endpoint[num_interrupt_in] = endpoint;

   ++num_interrupt_in;

  }

 }

 if (type == &generic_device) {

  num_ports = num_bulk_out;

  if (num_ports == 0) {

   err("Generic device with no bulk out, not allowed.");

   return NULL;

  }

 } else

  num_ports = type->num_ports;

 serial = get_free_serial (num_ports, &minor);

 if (serial == NULL) {

  err("No more free serial devices");

  return NULL;

 }

 serial->dev = dev;

 serial->type = type;

 serial->interface = interface;

 serial->minor = minor;

 serial->num_ports = num_ports;

 serial->num_bulk_in = num_bulk_in;

 serial->num_bulk_out = num_bulk_out;

 serial->num_interrupt_in = num_interrupt_in;

 serial->vendor = dev->descriptor.idVendor;

 serial->product = dev->descriptor.idProduct;

 /* set up the endpoint information */

 for (i = 0; i < num_bulk_in; ++i) {

  endpoint = bulk_in_endpoint[i];

  port = &serial->port[i];

  port->read_urb = usb_alloc_urb (0);

  if (!port->read_urb) {

   err("No free urbs available");

   goto probe_error;

  }

  //buffer_size = endpoint->wMaxPacketSize;

  buffer_size = 2048;

  port->bulk_in_endpointAddress = endpoint->bEndpointAddress;

  port->bulk_in_buffer = kmalloc (buffer_size, GFP_KERNEL);

  if (!port->bulk_in_buffer) {

   err("Couldn't allocate bulk_in_buffer");

   goto probe_error;

  }

  usb_fill_bulk_urb (port->read_urb, dev,

       usb_rcvbulkpipe (dev,

             endpoint->bEndpointAddress),

       port->bulk_in_buffer, buffer_size,

       ((serial->type->read_bulk_callback) ?

         serial->type->read_bulk_callback :

         generic_read_bulk_callback),

       port);

  //port->read_urb->transfer_flags |= URB_ASYNC_UNLINK;

 }

 for (i = 0; i < num_bulk_out; ++i) {

  endpoint = bulk_out_endpoint[i];

  port = &serial->port[i];

  port->write_urb = usb_alloc_urb(0);

  if (!port->write_urb) {

   err("No free urbs available");

   goto probe_error;

  }

  //buffer_size = endpoint->wMaxPacketSize;

  buffer_size = 2048;

  port->bulk_out_size = buffer_size;

  port->bulk_out_endpointAddress = endpoint->bEndpointAddress;

  port->bulk_out_buffer = kmalloc (buffer_size, GFP_KERNEL);

  if (!port->bulk_out_buffer) {

   err("Couldn't allocate bulk_out_buffer");

   goto probe_error;

  }

  usb_fill_bulk_urb (port->write_urb, dev,

       usb_sndbulkpipe (dev,

          endpoint->bEndpointAddress),

       port->bulk_out_buffer, buffer_size,

       ((serial->type->write_bulk_callback) ?

         serial->type->write_bulk_callback :

         generic_write_bulk_callback),

       port);

  //port->write_urb->transfer_flags |= URB_ASYNC_UNLINK;

 }

 for (i = 0; i < num_interrupt_in; ++i) {

  endpoint = interrupt_in_endpoint[i];

  port = &serial->port[i];

  port->interrupt_in_urb = usb_alloc_urb(0);

  if (!port->interrupt_in_urb) {

   err("No free urbs available");

   goto probe_error;

  }

  buffer_size = endpoint->wMaxPacketSize;

  port->interrupt_in_endpointAddress = endpoint->bEndpointAddress;

  port->interrupt_in_buffer = kmalloc (buffer_size, GFP_KERNEL);

  if (!port->interrupt_in_buffer) {

   err("Couldn't allocate interrupt_in_buffer");

   goto probe_error;

  }

  usb_fill_int_urb (port->interrupt_in_urb, dev,

      usb_rcvintpipe (dev,

        endpoint->bEndpointAddress),

      port->interrupt_in_buffer, buffer_size,

      //serial->type->read_int_callback, port,

     // khj modify 0919..

      ((serial->type->read_int_callback)?

     serial->type->read_int_callback :

     generic_int_callback), port,

      endpoint->bInterval);

 }

 /* initialize some parts of the port structures */

 /* we don't use num_ports here cauz some devices have more endpoint pairs than ports */

 max_endpoints = max(num_bulk_in, num_bulk_out);

 max_endpoints = max(max_endpoints, num_interrupt_in);

 max_endpoints = max(max_endpoints, (int)serial->num_ports);

 dbg("%s - setting up %d port structures for this device", __FUNCTION__, max_endpoints);

 for (i = 0; i < max_endpoints; ++i) {

  port = &serial->port[i];

  port->number = i + serial->minor;

  port->serial = serial;

  port->magic = USB_SERIAL_PORT_MAGIC;

  port->tqueue.routine = port_softint;

  port->tqueue.data = port;

  init_MUTEX (&port->sem);

 }

 /* if this device type has a startup function, call it */

 if (type->startup) {

  i = type->startup (serial);

  if (i < 0)

   goto probe_error;

  if (i > 0)

   return serial;

 }

 /* initialize the devfs nodes for this device and let the user know what ports we are bound to */

 for (i = 0; i < serial->num_ports; ++i) {

  tty_register_devfs (&serial_tty_driver, 0, serial->port[i].number);

  info("%s converter now attached to ttyUSB%d (or usb/tts/%d for devfs)",

       type->name, serial->port[i].number, serial->port[i].number);

  priv = (struct anydata_private*)serial->port[i].private;

  acm_set_control(serial,priv->ctrlout);

  priv->line.speed = cpu_to_le32(9600);

  priv->line.databits = 8;

  acm_set_line(serial,&priv->line);

 }

 state = 1;

/*

#ifdef ADM5120

 LED_INIT(GPIO_CDMA);

 LED_ON(GPIO_CDMA);

        kerneltimer_register(TIMEOUT);

#endif

*/

 return serial; /* success */

probe_error:

 for (i = 0; i < num_bulk_in; ++i) {

  port = &serial->port[i];

  if (port->read_urb)

   usb_free_urb (port->read_urb);

  if (port->bulk_in_buffer)

   kfree (port->bulk_in_buffer);

 }

 for (i = 0; i < num_bulk_out; ++i) {

  port = &serial->port[i];

  if (port->write_urb)

   usb_free_urb (port->write_urb);

  if (port->bulk_out_buffer)

   kfree (port->bulk_out_buffer);

 }

 for (i = 0; i < num_interrupt_in; ++i) {

  port = &serial->port[i];

  if (port->interrupt_in_urb)

   usb_free_urb (port->interrupt_in_urb);

  if (port->interrupt_in_buffer)

   kfree (port->interrupt_in_buffer);

 }

 /* return the minor range that this device had */

 return_serial (serial);

 /* free up any memory that we allocated */

 kfree (serial);

 return NULL;

}

static void usb_serial_disconnect(struct usb_device *dev, void *ptr)

{

 struct usb_serial *serial = (struct usb_serial *) ptr;

 struct usb_serial_port *port;

 int i;

 dbg ("%s", __FUNCTION__);

 if (serial) {

  /* fail all future close/read/write/ioctl/etc calls */

  for (i = 0; i < serial->num_ports; ++i) {

   port = &serial->port[i];

   down (&port->sem);

   if (port->tty != NULL) {

    while (port->open_count > 0) {

     __serial_close(port, NULL);

    }

    port->tty->driver_data = NULL;

   }

   up (&port->sem);

  }

  serial->dev = NULL;

  serial_shutdown (serial);

  for (i = 0; i < serial->num_ports; ++i)

   serial->port[i].open_count = 0;

  for (i = 0; i < serial->num_bulk_in; ++i) {

   port = &serial->port[i];

   if (port->read_urb) {

    usb_unlink_urb (port->read_urb);

    usb_free_urb (port->read_urb);

   }

   if (port->bulk_in_buffer)

    kfree (port->bulk_in_buffer);

  }

  for (i = 0; i < serial->num_bulk_out; ++i) {

   port = &serial->port[i];

   if (port->write_urb) {

    usb_unlink_urb (port->write_urb);

    usb_free_urb (port->write_urb);

   }

   if (port->bulk_out_buffer)

    kfree (port->bulk_out_buffer);

  }

  for (i = 0; i < serial->num_interrupt_in; ++i) {

   port = &serial->port[i];

   if (port->interrupt_in_urb) {

    usb_unlink_urb (port->interrupt_in_urb);

    usb_free_urb (port->interrupt_in_urb);

   }

   if (port->interrupt_in_buffer)

    kfree (port->interrupt_in_buffer);

  }

  for (i = 0; i < serial->num_ports; ++i) {

   tty_unregister_devfs (&serial_tty_driver, serial->port[i].number);

   info("%s converter now disconnected from ttyUSB%d", serial->type->name, serial->port[i].number);

  }

  /* return the minor range that this device had */

  return_serial (serial);

  /* free up any memory that we allocated */

  kfree (serial);

  state = 0;

  /*

#ifdef ADM5120

 del_timer(&timer);

 LED_OFF(GPIO_CDMA);

#endif

*/

 } else {

  info("device disconnected");

 }

}

static struct tty_driver serial_tty_driver = {

 .magic = TTY_DRIVER_MAGIC,

 .driver_name = "usb-serial",

#ifndef CONFIG_DEVFS_FS

 .name = "ttyUSB",

#else

 .name = "usb/tts/%d",

#endif

 .major = SERIAL_TTY_MAJOR,

 .minor_start = 0,

 .num = SERIAL_TTY_MINORS,

 .type = TTY_DRIVER_TYPE_SERIAL,

 .subtype = SERIAL_TYPE_NORMAL,

 .flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS,

 .refcount = &serial_refcount,

 .table = serial_tty,

 .termios = serial_termios,

 .termios_locked = serial_termios_locked,

 .open = serial_open,

 .close = serial_close,

 .write = serial_write,

 .write_room = serial_write_room,

 .ioctl = serial_ioctl,

 .set_termios = serial_set_termios,

 .throttle = serial_throttle,

 .unthrottle = serial_unthrottle,

 .break_ctl = serial_break,

 .chars_in_buffer = serial_chars_in_buffer,

 .read_proc = serial_read_proc,

};

int read_anydata_result(char* page, char **start, off_t off, int count, int * eof, void *data_unused)

{

 char * buf;

 buf = page;

 buf += sprintf(buf, "%d\n", state);

 *eof = 1;

 return buf - page;

}

static int __init usb_serial_init(void)

{

 int i;

 int result;

/*

 if(onframe_root_fp == NULL)

        {

                onframe_root_fp = proc_mkdir("onframe",0);

                onframe_val_fp = create_proc_entry("val",S_IFREG | S_IRWXU, onframe_root_fp);

                if(onframe_val_fp)

                {

                        onframe_val_fp->data = onframe_str;

                        onframe_val_fp->read_proc = read_onframe_val;

                        onframe_val_fp->write_proc = write_onframe_val;

                }

        }

  sprintf(onframe_val_fp->data,"%d",1);

*/

 /* Initalize our global data */

 for (i = 0; i < SERIAL_TTY_MINORS; ++i) {

  serial_table[i] = NULL;

 }

 /* register the tty driver */

 serial_tty_driver.init_termios = tty_std_termios;

 serial_tty_driver.init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;

 if (tty_register_driver (&serial_tty_driver)) {

  err("%s - failed to register tty driver", __FUNCTION__);

  return -1;

 }

 /* register the USB driver */

 result = usb_register(&usb_serial_driver);

 if (result < 0) {

  tty_unregister_driver(&serial_tty_driver);

  err("usb_register failed for the usb-serial driver. Error number %d", result);

  return -1;

 }

 generic_device_ids[0].idVendor = vendor;

 generic_device_ids[0].idProduct = product;

 generic_device_ids[0].match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT;

 generic_device_ids[1].idVendor = vendor;

 generic_device_ids[1].idProduct = product1;

 generic_device_ids[1].match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT;

 /* register our generic driver with ourselves */

 /* register our generic driver with ourselves */

 usb_serial_register (&generic_device);

 info(DRIVER_DESC " " DRIVER_VERSION);

 return 0;

}

static void __exit usb_serial_exit(void)

{

 /* remove our generic driver */

 usb_serial_deregister (&generic_device);

 usb_deregister(&usb_serial_driver);

 tty_unregister_driver(&serial_tty_driver);

}

module_init(usb_serial_init);

module_exit(usb_serial_exit);

int usb_serial_register(struct usb_serial_device_type *new_device)

{

 /* Add this device to our list of devices */

 list_add(&new_device->driver_list, &usb_serial_driver_list);

 info ("USB Serial support registered for %s", new_device->name);

 usb_scan_devices();

 return 0;

}

void usb_serial_deregister(struct usb_serial_device_type *device)

{

 struct usb_serial *serial;

 int i;

 info("USB Serial deregistering driver %s", device->name);

 /* clear out the serial_table if the device is attached to a port */

 for(i = 0; i < SERIAL_TTY_MINORS; ++i) {

  serial = serial_table[i];

  if ((serial != NULL) && (serial->type == device)) {

   usb_driver_release_interface (&usb_serial_driver, serial->interface);

   usb_serial_disconnect (NULL, serial);

  }

 }

 list_del(&device->driver_list);

}

/* If the usb-serial core is built into the core, the usb-serial drivers

   need these symbols to load properly as modules. */

//EXPORT_SYMBOL(usb_serial_register);

//EXPORT_SYMBOL(usb_serial_deregister);

/* Module information */

MODULE_AUTHOR( DRIVER_AUTHOR );

MODULE_DESCRIPTION( DRIVER_DESC );

MODULE_LICENSE("GPL");

MODULE_PARM(debug, "i");

MODULE_PARM_DESC(debug, "Debug enabled or not");

#ifdef CONFIG_USB_SERIAL_GENERIC

MODULE_PARM(vendor, "h");

MODULE_PARM_DESC(vendor, "User specified USB idVendor");

MODULE_PARM(product, "h");

MODULE_PARM_DESC(product, "User specified USB idProduct");

#endif

Revision history for this message
Pedrosal (pedro-angola-trade) said :
#10

Here goes the ANYDATA.H CONTENT:

#ifndef CMSPAR

#define CMSPAR 0

#endif

#define USB_RT_ACM 0x21 // in acm.c 0x21

#define ACM_REQ_COMMAND 0x00

#define ACM_REQ_RESPONSE 0x01

#define ACM_REQ_SET_FEATURE 0x02

#define ACM_REQ_GET_FEATURE 0x03

#define ACM_REQ_CLEAR_FEATURE 0x04

#define ACM_REQ_SET_LINE 0x20

#define ACM_REQ_GET_LINE 0x21

#define ACM_REQ_SET_CONTROL 0x22

#define ACM_REQ_SEND_BREAK 0x23

#define ACM_IRQ_NETWORK 0x00

#define ACM_IRQ_LINE_STATE 0x20

#define ACM_CTRL_DTR 0x01

#define ACM_CTRL_RTS 0x02

#define ACM_CTRL_DCD 0x01

#define ACM_CTRL_DSR 0x02

#define ACM_CTRL_BRK 0x04

#define ACM_CTRL_RI 0x08

#define ACM_CTRL_FRAMING 0x10

#define ACM_CTRL_PARITY 0x20

#define ACM_CTRL_OVERRUN 0x40

struct acm_line {

 __u32 speed;

 __u8 stopbits;

 __u8 parity;

 __u8 databits;

} __attribute__((packed));

MAKEFILE CONTENT
CC=gcc

KERNELDIR= /lib/modules/$(shell uname -r)/build

CFLAGS= -D__KERNEL__ -DMODULE -I$(KERNELDIR)/include -O -Wall -c

DRIVER=AnyDATA_acm

TARGET=$(DRIVER).o

all: $(TARGET)

$(TARGET):

 $(CC) -o $(TARGET) ${CFLAGS} anydata.c

clean:

 rm -rf $(TARGET)

install:

Revision history for this message
Pedrosal (pedro-angola-trade) said :
#11

And now the RUN.SH CONTENTS

#!/bin/sh

insmod usbcore

insmod usb-uhci

ifconfig eth0 down

make clean

make

insmod AnyDATA_acm.o

kppp

Revision history for this message
Pedrosal (pedro-angola-trade) said :
#12

And here we have USB-SERIAL.H CONTENTS

#ifndef __LINUX_USB_SERIAL_H

#define __LINUX_USB_SERIAL_H

#include <linux/config.h>

#define SERIAL_TTY_MAJOR 188 /* Nice legal number now */

#define SERIAL_TTY_MINORS 255 /* loads of devices :) */

#define MAX_NUM_PORTS 8 /* The maximum number of ports one device can grab at once */

#define USB_SERIAL_MAGIC 0x6702 /* magic number for usb_serial struct */

#define USB_SERIAL_PORT_MAGIC 0x7301 /* magic number for usb_serial_port struct */

/* parity check flag */

#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))

/**

 * usb_serial_port: structure for the specific ports of a device.

 * @magic: magic number for internal validity of this pointer.

 * @serial: pointer back to the struct usb_serial owner of this port.

 * @tty: pointer to the coresponding tty for this port.

 * @number: the number of the port (the minor number).

 * @interrupt_in_buffer: pointer to the interrupt in buffer for this port.

 * @interrupt_in_urb: pointer to the interrupt in struct urb for this port.

 * @interrupt_in_endpointAddress: endpoint address for the interrupt in pipe

 * for this port.

 * @bulk_in_buffer: pointer to the bulk in buffer for this port.

 * @read_urb: pointer to the bulk in struct urb for this port.

 * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this

 * port.

 * @bulk_out_buffer: pointer to the bulk out buffer for this port.

 * @bulk_out_size: the size of the bulk_out_buffer, in bytes.

 * @write_urb: pointer to the bulk out struct urb for this port.

 * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this

 * port.

 * @write_wait: a wait_queue_head_t used by the port.

 * @tqueue: task queue for the line discipline waking up.

 * @open_count: number of times this port has been opened.

 * @sem: struct semaphore used to lock this structure.

 * @private: place to put any driver specific information that is needed. The

 * usb-serial driver is required to manage this data, the usb-serial core

 * will not touch this.

 *

 * This structure is used by the usb-serial core and drivers for the specific

 * ports of a device.

 */

struct usb_serial_port {

 int magic;

 struct usb_serial *serial;

 struct tty_struct * tty;

 unsigned char number;

 unsigned char * interrupt_in_buffer;

 struct urb * interrupt_in_urb;

 __u8 interrupt_in_endpointAddress;

 unsigned char * bulk_in_buffer;

 struct urb * read_urb;

 __u8 bulk_in_endpointAddress;

 unsigned char * bulk_out_buffer;

 int bulk_out_size;

 struct urb * write_urb;

 __u8 bulk_out_endpointAddress;

 wait_queue_head_t write_wait;

 struct tq_struct tqueue;

 int open_count;

 struct semaphore sem;

 void * private;

};

/**

 * usb_serial - structure used by the usb-serial core for a device

 * @magic: magic number for internal validity of this pointer.

 * @dev: pointer to the struct usb_device for this device

 * @type: pointer to the struct usb_serial_device_type for this device

 * @interface: pointer to the struct usb_interface for this device

 * @minor: the starting minor number for this device

 * @num_ports: the number of ports this device has

 * @num_interrupt_in: number of interrupt in endpoints we have

 * @num_bulk_in: number of bulk in endpoints we have

 * @num_bulk_out: number of bulk out endpoints we have

 * @vendor: vendor id of this device

 * @product: product id of this device

 * @port: array of struct usb_serial_port structures for the different ports.

 * @private: place to put any driver specific information that is needed. The

 * usb-serial driver is required to manage this data, the usb-serial core

 * will not touch this.

 */

struct usb_serial {

 int magic;

 struct usb_device * dev;

 struct usb_serial_device_type * type;

 struct usb_interface * interface;

 unsigned char minor;

 unsigned char num_ports;

 char num_interrupt_in;

 char num_bulk_in;

 char num_bulk_out;

 __u16 vendor;

 __u16 product;

 struct usb_serial_port port[MAX_NUM_PORTS];

 void * private;

};

#define NUM_DONT_CARE (-1)

/**

 * usb_serial_device_type - a structure that defines a usb serial device

 * @owner: pointer to the module that owns this device.

 * @name: pointer to a string that describes this device. This string used

 * in the syslog messages when a device is inserted or removed.

 * @id_table: pointer to a list of usb_device_id structures that define all

 * of the devices this structure can support.

 * @num_interrupt_in: the number of interrupt in endpoints this device will

 * have.

 * @num_bulk_in: the number of bulk in endpoints this device will have.

 * @num_bulk_out: the number of bulk out endpoints this device will have.

 * @num_ports: the number of different ports this device will have.

 * @calc_num_ports: pointer to a function to determine how many ports this

 * device has dynamically. It will be called after the probe()

 * callback is called, but before attach()

 * @startup: pointer to the driver's startup function.

 * This will be called when the device is inserted into the system,

 * but before the device has been fully initialized by the usb_serial

 * subsystem. Use this function to download any firmware to the device,

 * or any other early initialization that might be needed.

 * Return 0 to continue on with the initialization sequence. Anything

 * else will abort it.

 * @shutdown: pointer to the driver's shutdown function. This will be

 * called when the device is removed from the system.

 *

 * This structure is defines a USB Serial device. It provides all of

 * the information that the USB serial core code needs. If the function

 * pointers are defined, then the USB serial core code will call them when

 * the corresponding tty port functions are called. If they are not

 * called, the generic serial function will be used instead.

 */

struct usb_serial_device_type {

 struct module *owner;

 char *name;

 const struct usb_device_id *id_table;

 char num_interrupt_in;

 char num_bulk_in;

 char num_bulk_out;

 char num_ports;

 struct list_head driver_list;

 int (*startup) (struct usb_serial *serial);

 void (*shutdown) (struct usb_serial *serial);

 /* serial function calls */

 int (*open) (struct usb_serial_port *port, struct file * filp);

 void (*close) (struct usb_serial_port *port, struct file * filp);

 int (*write) (struct usb_serial_port *port, int from_user, const unsigned char *buf, int count);

 int (*write_room) (struct usb_serial_port *port);

 int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg);

 void (*set_termios) (struct usb_serial_port *port, struct termios * old);

 void (*break_ctl) (struct usb_serial_port *port, int break_state);

 int (*chars_in_buffer) (struct usb_serial_port *port);

 void (*throttle) (struct usb_serial_port *port);

 void (*unthrottle) (struct usb_serial_port *port);

 void (*read_int_callback)(struct urb *urb);

 void (*read_bulk_callback)(struct urb *urb);

 void (*write_bulk_callback)(struct urb *urb);

};

extern int usb_serial_register(struct usb_serial_device_type *new_device);

extern void usb_serial_deregister(struct usb_serial_device_type *device);

/* determine if we should include the EzUSB loader functions */

#undef USES_EZUSB_FUNCTIONS

#if defined(CONFIG_USB_SERIAL_KEYSPAN_PDA) || defined(CONFIG_USB_SERIAL_KEYSPAN_PDA_MODULE)

 #define USES_EZUSB_FUNCTIONS

#endif

#if defined(CONFIG_USB_SERIAL_XIRCOM) || defined(CONFIG_USB_SERIAL_XIRCOM_MODULE)

 #define USES_EZUSB_FUNCTIONS

#endif

#if defined(CONFIG_USB_SERIAL_KEYSPAN) || defined(CONFIG_USB_SERIAL_KEYSPAN_MODULE)

 #define USES_EZUSB_FUNCTIONS

#endif

#if defined(CONFIG_USB_SERIAL_WHITEHEAT) || defined(CONFIG_USB_SERIAL_WHITEHEAT_MODULE)

 #define USES_EZUSB_FUNCTIONS

#endif

#ifdef USES_EZUSB_FUNCTIONS

extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest);

extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit);

#endif

/* Inline functions to check the sanity of a pointer that is passed to us */

static inline int serial_paranoia_check (struct usb_serial *serial, const char *function)

{

 if (!serial) {

  dbg("%s - serial == NULL", function);

  return -1;

 }

 if (serial->magic != USB_SERIAL_MAGIC) {

  dbg("%s - bad magic number for serial", function);

  return -1;

 }

 if (!serial->type) {

  dbg("%s - serial->type == NULL!", function);

  return -1;

 }

 return 0;

}

static inline int port_paranoia_check (struct usb_serial_port *port, const char *function)

{

 if (!port) {

  dbg("%s - port == NULL", function);

  return -1;

 }

 if (port->magic != USB_SERIAL_PORT_MAGIC) {

  dbg("%s - bad magic number for port", function);

  return -1;

 }

 if (!port->serial) {

  dbg("%s - port->serial == NULL", function);

  return -1;

 }

 if (!port->tty) {

  dbg("%s - port->tty == NULL", function);

  return -1;

 }

 return 0;

}

static inline struct usb_serial* get_usb_serial (struct usb_serial_port *port, const char *function)

{

 /* if no port was specified, or it fails a paranoia check */

 if (!port ||

  port_paranoia_check (port, function) ||

  serial_paranoia_check (port->serial, function)) {

  /* then say that we dont have a valid usb_serial thing, which will

   * end up genrating -ENODEV return values */

  return NULL;

 }

 return port->serial;

}

static inline void usb_serial_debug_data (const char *file, const char *function, int size, const unsigned char *data)

{

 int i;

 if (!debug)

  return;

 printk (KERN_DEBUG "%s: %s[%d], data = ", file, function, size);

 for (i = 0; i < size; ++i) {

  if(data[i] == 0x7d)

  {

   if(data[i+1] == 0x5e)

   {

    printk("%.2X ",0x7e);

   }

   else

    printk("%.2X ", data[i+1] ^ 0x20);

   i++;

  }

  else

   printk ("%.2X ", data[i]);

 }

 printk ("\n");

}

/* Use our own dbg macro */

#undef dbg

#define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG __FILE__ ": " format "\n" , ## arg); } while (0)

#endif /* ifdef __LINUX_USB_SERIAL_H */

Revision history for this message
Pedrosal (pedro-angola-trade) said :
#13

Sorry, I made a mistake on the cutting and pasting. About 12 lines from the bottom of ANYDATA.H you can see that I've included MAKEFILE's CONTENTS. These are separate files.

Revision history for this message
Pedrosal (pedro-angola-trade) said :
#14

Hi Spike, please don't abandon me on this one. I appreciate you are volunteering your time and effort. I would really like to see this one up and running.

Revision history for this message
Brewster Malevich (brews) said :
#15

I hear you.
I've recreated the files on my computer as well. Most of the text you've sent me is C source code that will need to be compiled (easy enough) but I'm not sure whether we need to configure any of these files first. ~Hopefully~ they have an automatic script which does all of this for us. But I haven't looked through it enough.

Please understand that I have final exams for this week and the next two weeks, so I'm sorry that I'm not able to give you as much time as I would like. I was hoping someone might give us a hand with compiling those USB drivers, but it doesn't look like we're getting much help yet. Compiling undocumented CDMA USB drivers is a violation of basic human rights, and no man should have to do it alone. ha ha ha

I'm committed to working through this problem, it may take some time though. Keep the question "open" and I'll do my best to help you.

Also...I've noticed that Fedora 9 has some new features that include better support for CDMA/GSM through network manager. I'm going to download a beta live-cd and see how they have things setup. It will be cool when those features come to Ubuntu (next release, most likely). USB modems and CDMA devices, in particular, have always been tricky to setup on linux because the device manufacturers are traditionally very 'closed'.

Revision history for this message
Brewster Malevich (brews) said :
#16

Oh yes,
I am not sure how much you know about coding...but this helps to explain:

A program is just a list of instructions for your computer. You can divide programing languages into two types: interpreted and compiled.

"C" is an old compiled programing language. It is very fast because it is 'close to the machine'. Linux, the kernel of Ubuntu, is all written in C and many linux programs are also written in C.

All programs are essentially simple text files and can be modified and edited, with compiled languages these files are called 'source code'. Once all of the code is written down, it is run through a compiler which makes the source code an actual program, or 'binary' (assuming there are no errors or bugs in the source). The compiler basically turns all the source code's instructions into binary machine code (1010 1001), thus the name "binary". Developing a program with compiled language can be tedious and time-consuming.

Interpreted languages are flexible, don't need to be compiled, and much much easier and faster to write. The trouble is that they are usually much slower than compiled languages. A good example of an interpreted language is Python. Python is the 'official language' of Ubuntu. Python would probably be my preferred language as well.

Revision history for this message
Brewster Malevich (brews) said :
#17

Plug in the modem.

Open up a terminal and type:
lsusb

Cut and paste the output here.

Revision history for this message
Pedrosal (pedro-angola-trade) said :
#18

Hi there! Good luck with the studies and exams and really there's no time crisis. Thanks for the explanation on coding. It makes sense but it's still fairly foreign unfortunately. I think there is an automatic script in there (run.sh?)

I ran lsusb twice - once with the modem in the first usb port and the second time with the modem in the second port. The change is in line: Bus 003 Device 004: ID 16d5:6501

Here goes the full text:

swlltd@swlltd-laptop:~$ lsusb
Bus 007 Device 001: ID 0000:0000
Bus 006 Device 003: ID 05ca:183a Ricoh Co., Ltd
Bus 006 Device 001: ID 0000:0000
Bus 005 Device 002: ID 044e:3017 Alps Electric Co., Ltd
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 002: ID 16d5:6501
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 002: ID 147e:2016
Bus 001 Device 001: ID 0000:0000
swlltd@swlltd-laptop:~$ lsusb
Bus 007 Device 001: ID 0000:0000
Bus 006 Device 003: ID 05ca:183a Ricoh Co., Ltd
Bus 006 Device 001: ID 0000:0000
Bus 005 Device 002: ID 044e:3017 Alps Electric Co., Ltd
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 004: ID 16d5:6501
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 002: ID 147e:2016
Bus 001 Device 001: ID 0000:0000

Revision history for this message
Pedrosal (pedro-angola-trade) said :
#19

I tested the 64-bit Ubuntu 8.04 version off an installer CD. Although it frequently crashes on boot, I saw something interesting on the system log. When I plug in the modem, it is recognised.

Please see the report exract below:
-bitMay 5 11:49:58 ubuntu kernel: [ 468.829079] usb 3-1: new full speed USB device using uhci_hcd and address 2
May 5 11:49:59 ubuntu kernel: [ 468.854741] usb 3-1: configuration #1 chosen from 1 choice
May 5 11:50:02 ubuntu kernel: [ 472.040244] usbcore: registered new interface driver usbserial
May 5 11:50:02 ubuntu kernel: [ 472.040278] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
May 5 11:50:02 ubuntu kernel: [ 472.040361] usbcore: registered new interface driver usbserial_generic
May 5 11:50:02 ubuntu kernel: [ 472.040366] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: USB Serial Driver core
May 5 11:50:02 ubuntu kernel: [ 472.047365] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: USB Serial support registered for GSM modem (1-port)
May 5 11:50:02 ubuntu kernel: [ 472.047423] option 3-1:1.0: GSM modem (1-port) converter detected
May 5 11:50:02 ubuntu kernel: [ 472.047615] usb 3-1: GSM modem (1-port) converter now attached to ttyUSB0
May 5 11:50:02 ubuntu kernel: [ 472.047635] option 3-1:1.1: GSM modem (1-port) converter detected
May 5 11:50:02 ubuntu kernel: [ 472.047746] usb 3-1: GSM modem (1-port) converter now attached to ttyUSB1
May 5 11:50:02 ubuntu kernel: [ 472.047766] usbcore: registered new interface driver option
May 5 11:50:02 ubuntu kernel: [ 472.047770] /build/buildd/linux-2.6.24/drivers/usb/serial/option.c: USB Driver for GSM modems: v0.7.1

This compares to the following under my installed x86 version of 8.04:
May 5 12:07:54 swlltd-laptop kernel: [ 383.280640] usb 3-1: new full speed USB device using uhci_hcd and address 3
May 5 12:07:54 swlltd-laptop kernel: [ 383.442576] usb 3-1: configuration #1 chosen from 1 choice

I couldn't get a conection, and will probably have to install the gnome-PPP dialler and configure it. I'll get the chance later to figure this out properly.

I have an intel core 2 duo T8100 (2.10Ghz_ processor, This should run the 64-bit version? The screen doesn't look completely correct and as I say it crashes frequently. On boot and if I switch on the wireless function, for example.

Otherwise I could just re-install the x86 version and hopefully it would do the same.

Revision history for this message
Brewster Malevich (brews) said :
#20

Yeah, your processor is x86_64. Lets give it a try and see what we get. I have to admit I don't have experience with 64-bit processors, but lets give it a shot.

I think part of it is that your x86 installation might have been the release candidate and not the final version. This may be why, it may not.

You can use the gnome-ppp. if you'd rather, we can also do it with the command line (it uses the same program as gnome-ppp):

wvdialconf

(this command should help you detect the modem)
If everything is allright, then run the command:

pppconfig

Then use:

pon <nameoftheconnectionfilefrompppconfig>
And that -should- connect.

Revision history for this message
gmulak (george-americanfinancialtax) said :
#21

Do you know if the same kind of solution might work with a Novatel (cellular) Modem? Model EXPD E720 sold by Verizon. I am in a location where I cannot connect to the internet except by using a cellular wireless card.

Revision history for this message
João Miguel Lopes Moreira (jmlm-1970) said :
#22

It is quite simple just install gnome-ppp (if you do not have internet, just download from other computer to a removable media, the deb files and all dependencies, like google search: linux deb package download "gnome-ppp" )...

After install, run terminal:

sudo gnome-ppp

Put your user and password from ISP and at dial #777, then click setup, then click detect, and it should show ttyUSB0, then click phone numbers, and put one #777 entry, then click close, then click init strings, and put two entries, one ATZ, and one ATI, click close, then click close again, then click connect, and should work fine...

Do not close the terminal, otherwise will close the gnome-ppp... Only close terminal after click disconnect in gnome-ppp and getting prompt in the terminal window...

Revision history for this message
João Miguel Lopes Moreira (jmlm-1970) said :
#23

if authentication gets failure, edit:

/etc/ppp/pap-secrets

  *
"user number" * "password"
user number * password

and also edit:

/etc/ppp/chap-secrets

# Secrets for authentication using CHAP
# client server secret IP addresses
#"tttttttt" * "fdsds"
"user number" * "password"
user number * password

launch gnome-ppp again and should work just fine...

Can you help with this problem?

Provide an answer of your own, or ask Pedrosal for more information if necessary.

To post a message you must log in.