2

I am using Sierra Aircard modem

While Configuring Dial Port/PPP port ,I am opening This port(deb/ttyUSB3) like this

    struct termios tio;
memset(&tio, 0, sizeof(termios));

if ((fdDataPort = open(portName, O_RDWR | O_NOCTTY| O_SYNC | O_NONBLOCK )) != -1)
{
    cfmakeraw (&tio);
    printf("After OpenDataPort call");
    tio.c_iflag = 0;//IGNCR;
    tio.c_cflag |= CLOCAL | CREAD;

    tcflush(fdDataPort, TCIOFLUSH);
    tcsetattr(fdDataPort, TCSANOW, &tio);
    tcflush(fdDataPort, TCIOFLUSH);
    tcflush(fdDataPort, TCIOFLUSH);
    cfsetispeed(&tio, B115200);
    cfsetospeed(&tio, B115200);
    tcsetattr(fdDataPort, TCSANOW, &tio);
    printf("After tcsetattr call");
    return true;
}
else
{
    return false;
}

This configuration is working perfectly fine till now for connection establishment. Reconnecting etc

But I have one problem wrt this method : If i remove dongle when this operation is in progress(only few mili seconds) i am not able to detect dongle removal in my physical-device-manager(This process does device management modeswitch etc...) because msg is not received from kernel layer . also if i remove dongle also /dev/ttyUSB3 still persists (0,1,2 are released) . Kindly let me know if this is a right way to open the port or any other method is available .Appreciate your help

EDIT

Below is the ERROR log from dmesg

 49.463282] 5864 slab pages
[   49.463286] 943924 pages shared
[   49.463291] 0 pages swap cached
[   49.465229] FAT-fs (sda1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
[   49.511839] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[   51.120554] usb 1-1: USB disconnect, device number 4
[   51.153175] sierra ttyUSB0: Sierra USB modem converter now disconnected from ttyUSB0
[   51.153546] sierra 1-1:1.0: device disconnected
[   51.185779] sierra ttyUSB1: Sierra USB modem converter now disconnected from ttyUSB1
[   51.186091] sierra 1-1:1.1: device disconnected
[   51.233531] sierra ttyUSB2: Sierra USB modem converter now disconnected from ttyUSB2
[   51.233888] sierra 1-1:1.3: device disconnected
[   51.242018] sierra ttyUSB3: sierra_submit_rx_urbs: submit urb failed: -19
[   51.242032] sierra ttyUSB3: sierra_submit_rx_urbs: submit urb failed: -19
[   51.242040] sierra ttyUSB3: sierra_submit_rx_urbs: submit urb failed: -19
[   51.242047] sierra ttyUSB3: sierra_submit_rx_urbs: submit urb failed: -19
[   51.242054] sierra ttyUSB3: sierra_submit_rx_urbs: submit urb failed: -19
[   51.242060] sierra ttyUSB3: sierra_submit_rx_urbs: submit urb failed: -19
[   51.242066] sierra ttyUSB3: sierra_submit_rx_urbs: submit urb failed: -19
[   51.242073] sierra ttyUSB3: sierra_submit_rx_urbs: submit urb failed: -19
[   51.617553] sd 1:0:0:0: [sda] Unhandled error code
[   51.617569] sd 1:0:0:0: [sda]
[   51.617575] Result: hostbyte=0x07 driverbyte=0x00
[   51.617582] sd 1:0:0:0: [sda] CDB:
[   51.617587] cdb[0]=0x28: 28 00 00 00 0d 27 00 00 01 00
[   51.617619] end_request: I/O error, dev sda, sector 3367
[   51.617674] sd 1:0:0:0: [sda] Unhandled error code
[   51.617682] sd 1:0:0:0: [sda]
[   51.617687] Result: hostbyte=0x07 driverbyte=0x00
[   51.617693] sd 1:0:0:0: [sda] CDB:
[   51.617698] cdb[0]=0x28: 28 00 00 00 0d 28 00 00 01 00

I am stuck please help

Gajukorse
  • 147
  • 2
  • 11

0 Answers0